Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Cloning Help, Local Scripts on server?

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?

2 comments

0

Bump

0

Where is the script located?

2 answers

✓ Accepted answer

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.

1 comment

1

Or he could use a repeat loop.

This discussion is preserved as it was. New answers, comments, and votes are closed.