How can I make
local SCP049=script.Parent; local clone = SCP049:Clone() SCP049.Humanoid.Died:connect(function() wait(5) SCP049:Destroy() clone.Parent = Workspace end)
repeat when its done without making roblox crash?
When the initial Humanoid dies -that's it. The event never fires again. You have to attach a new function to the new humanoid.
However, you can't make infinitely complex code, so you can't use an anonymous function here:
local SCP049 = script.Parent; local clone = SCP049:Clone() function respawn() wait(5) SCP049:Destroy() SCP049 = clone:Clone() SCP049.Parent = workspace SCP049.Humanoid.Died:connect(respawn) end SCP049.Humanoid.Died:connect(respawn)
Simple, use a
while true do end
Just put that script in there and put a wait somewhere in there like this
while true do wait(1) end
so it doesn't keep repeating every like 0.1 of a second. It would lag out and crash your server!
If you have any questions feel free to ask : )
Locked by youtubemasterWOW
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?