Ad
Log in to vote
-1

Cloning Help, Local Scripts on server?

Asked by 7 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 — 7y
0
Where is the script located? Everesty 1001 — 7y

2 answers

Log in to vote
0
Answered by
Azarth 3113 Moderation Voter Community Moderator
7 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 7 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. Everesty 1001 — 7y

Answer this question