Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Cloning Help, Local Scripts on server?

Asked by 10 years ago
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?

0
Bump tkddude2 75 — 10y
0
Where is the script located? User#2 0 — 10y

2 answers

Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
10 years ago

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

Ad
Log in to vote
-1
Answered by 10 years ago
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
Or he could use a repeat loop. User#2 0 — 10y

Answer this question