Hey guys, so I'm working on an enemy spawn script and I'm not sure this is the best idea, but I run into this all the time with cloning.
So basically every time I clone something, for example if I have a button cloning something (for instance a tool) from server storage then when i click it a second time it just deletes the old one. Can anyone help me with this?
local clone = game.ReplicatedStorage.XenScripted:Clone() while true do clone.Parent = game.Workspace clone:MoveTo(Vector3.new(47.71, 11.422, -150.51)) wait(math.random(3,10)) end
I see the issue. You cloned it out of the while true do loop so it deletes itself and teleport's itself back to the position that it was when it was cloned.
while true do local clone = game.ReplicatedStorage.XenScripted:Clone() clone.Parent = game.Workspace clone:MoveTo(Vector3.new(47.71, 11.422, -150.51)) wait(math.random(3,10)) end