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

Help with :Clone()?

Asked by
novipak 70
10 years ago

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

Log in to vote
2
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

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
0
Thanks a lot! It worked! novipak 70 — 10y
Ad

Answer this question