How do I Respawn an Object when a Player Dies

You have two of the same variables, if the 2nd line in your script doesn’t serve any purpose then I advise you remove it as it could be causing the complications.

I also believe you’re trying to check if the box is in workspace for the 8-10th line? Instead of a numerical value you can just do:

If game.Workspace:FindFirstChild("box") then
game.Workspace.box:Destroy()
end

:FindFirstChild() checks the descendant you define, this being workspace, so you’re essentially checking if you find the box in workspace, and if you do you destroy it.

2 Likes

thank you for the tips but it still doesn’t work locally.

My memory is dodgy which is why I didn’t mention this earlier, but I’m not entirely sure if you can clone a part locally, I think your best bet is to make use of Remote Functions and Events in order to help you do this, but if a better solution comes up definitely use that.

1 Like

Oh, ok I’ll see about that then. So, for this I would need a server to client, right?

It depends for what you’re exactly going for in the script, but for this case probably yes.