while true do local char = game.Players.LocalPlayer.Character char.Archivable = true charactercopy = char:Clone() print(charactercopy) charactercopy.Parent = Workspace wait(10) end
In this script it clones the character every 10 seconds. This works fine when I test play it in studio, but when I publish it to roblox it stops working. Help?
LocalScript's should either be placed in StarterGui or StarterPack:
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character local char = game.Players.LocalPlayer.Character char.Archivable = true while true do charactercopy = char:Clone() charactercopy.Parent = Workspace wait(10) end
wait(2) while true do local char = game.Players.LocalPlayer.Character char.Archivable = true charactercopy = char:Clone() print(charactercopy) charactercopy.Parent = Workspace wait(10) end
Adding a wait(2) at the start will ensure that your character actually exists when the script tries to run.