Hello people, quick help here

No, when as in if part got destroyed = rest of the script here

1 Like

have you seen my code post above?

1 Like

ok you have two options, yield until Destroyed is fired or connect the event

1 Like

You don’t need that tho, it’s just a waste of time, and possibly a memory leak, but because you asked…

local part = part

while Wait() do
    if workspace:FindFirstChild(part) == nil then
        --do stuff
    end
end
1 Like

Do i put this into the part which is going to be destroyed?

1 Like

Part.Destroying:Connect(YourFunction)

2 Likes

That’s what my, @V_ladzec, and @MeltLava800 code does, I would advise @V_ladzec’s code tho

1 Like

Okay. And last thing. Would your code support a localscript?

1 Like

not sure why you would prefer one over the other because i just described the same thing he did with extra if you want to yield

1 Like

I mean, would his code work with localscript? I need a localscript supporting version of his code if not

1 Like

Localscript, clientside, whateva

1 Like

this works both for localscript and serverscript

1 Like

Please make sure to be more descriptive in the title in the future – this title explains pretty much nothing about your problem and even the original post lacks a lot of information.

1 Like

Simply meant if he means to use it @V_ladzec’s is already working, you explained it tho

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.