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

Help with :Clone()?

So I am just starting on trying to make my game, and I want to make it so that whenever a string variable's value is "Loading..." it will clone in a map I have.

This is the error I'm getting:

Workspace.mapLoader:8: attempt to index global 'Fallen' (a nil value)

Here is my code:

--{{VARIABLES}}--
g = game.Workspace.gameRunner.inGame
s = g.Parent.status
--{{CHECKER}}--
while true do
if s.Value == "Loading..." then
game.ServerStorage.Fallen:Clone()
Fallen.Parent = game.Workspace
wait(20)
end
wait(1)
end

1 answer

✓ Accepted answer

To the script, it appeared you were using Fallen as a tag on that line, and with your script, you don't really need a separate line for fallen. Just do Clone().Parent = workspace

--{{VARIABLES}}--
g = game.Workspace.gameRunner.inGame
s = g.Parent.status
--{{CHECKER}}--
while true do
if s.Value == "Loading..." then
game.ServerStorage.Fallen:Clone().Parent = game.Workspace
wait(20)
end
wait(1)
end

1 comment

0

Thanks a lot! It worked!

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