#All childeren in a folder are destryoing when I start the game

1 messages · Page 1 of 1 (latest)

limber sparrow
#

How can I see which script is deleting? Why it happens

vivid ridgeBOT
#

studio** You are now Level 1! **studio

limber sparrow
#

Its like that

#

Gone when I start

unborn ermine
limber sparrow
#

workplsace

#

workspace

heady basin
#

use AncestryChanged

limber sparrow
#

I did

heady basin
#

what it said

limber sparrow
#

let me find whole log

#

[DEBUG]: 5 - Server- Script:6
ServerScriptService.Script:7

print(debug.traceback()) returned empty

heady basin
#

did you download anyting from toolbox that contained scripts?

limber sparrow
#

Yes but I deleted them all

heady basin
#

try debug.traceback("Traceback", 2)

limber sparrow
#

Delete: 6
Traceback

Delete: 2
Traceback

(...)

#

I'm not sure if I'm using it correctly, how should I use it?

heady basin
#
local function debugDestroy(instance)
    local oldDestroy = instance.Destroy

    instance.Destroy = function(self)
        print("debug here:", self:GetFullName())
        print(debug.traceback())
        oldDestroy(self)
    end

    return instance
end

local folder = workspace:WaitForChild("your folder")
for _, child in ipairs(folder:GetChildren()) do
    debugDestroy(child)
end

#

put this in LocalScript or ServerScript

limber sparrow
#

alr

#

Destroy is not a valid member of Part "Workspace.SellAreas.6" - Sunucu - Script:4
Stack Begin - Studio
Script 'ServerScriptService.Script', Line 4 - function debugDestroy - Studio - Script:4
Script 'ServerScriptService.Script', Line 15 - Studio - Script:15
Stack End

#

What does it mean

heady basin
#

uhhh

#
local folder = workspace:WaitForChild("SellAreas")

for _, child in ipairs(folder:GetChildren()) do
    child.AncestryChanged:Connect(function(_, parent)
        if not parent then
            warn("deleted -> ", child:GetFullName())
            warn(debug.traceback())
        end
    end)
end
#

last try

#

can you check if it's only "parts" that are getting destroyed

limber sparrow
#

It is yes

vivid ridgeBOT
#

studio** You are now Level 2! **studio

limber sparrow
#

deleted -> 6 - Sunucu - Script:6
19:31:34.770 ServerScriptService.Script:7

  • Sunucu - Script:7
    19:31:34.770 deleted -> 2 - Sunucu - Script:6
    19:31:34.770 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:31:34.770 deleted -> 3 - Sunucu - Script:6
    19:31:34.770 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:31:34.770 deleted -> 4 - Sunucu - Script:6
    19:31:34.770 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:31:34.770 deleted -> 1 - Sunucu - Script:6
    19:31:34.771 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:31:34.771 deleted -> 5 - Sunucu - Script:6
    19:31:34.771 ServerScriptService.Script:7
heady basin
#

ok

#

that narrows it down

#

rename parts

#

just call it p1, p2, p3 etc

limber sparrow
#

alr

#

still the same

#

oh wait

#

my bad

#

okay still the same

#

deleted -> p6 - Sunucu - Script:6
19:44:14.221 ServerScriptService.Script:7

  • Sunucu - Script:7
    19:44:14.221 deleted -> p2 - Sunucu - Script:6
    19:44:14.221 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:44:14.221 deleted -> p3 - Sunucu - Script:6
    19:44:14.221 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:44:14.221 deleted -> p4 - Sunucu - Script:6
    19:44:14.221 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:44:14.221 deleted -> p1 - Sunucu - Script:6
    19:44:14.221 ServerScriptService.Script:7
  • Sunucu - Script:7
    19:44:14.222 deleted -> p5 - Sunucu - Script:6
    19:44:14.222 ServerScriptService.Script:7
heady basin
#

no idea

limber sparrow
#

it's so ridiculous

heady basin
#

also I'm just a beginner, maybe some experienced guy could help

heady basin
heady basin
limber sparrow
#

Could this be due to a code I wrote?

heady basin
#

can you share

limber sparrow
#

I have codes with ClearAllChildren but even if I delete them the same result

limber sparrow
lethal glacier
#

silly question but are all your parts unanchored and cancollide false?

#

@limber sparrow

#

also debug.traceback will only give u traceback from the script that detected the change not the script that actually destroys it

limber sparrow
#

Let me check

limber sparrow
#

Wait

#

It should be anchored?

#

How did I forget to anchor...

#

Working now thanks.
They should already be anchored, but why do they disappear when they are not anchored? @lethal glacier

#

I gave 3 hours for this lol