attempt to index local 'clone' (a nil value)?
Ok, so, I have this script:
01 | game.Players.PlayerAdded:connect( function (player) |
03 | repeat wait() until player.Character |
05 | local random = math.random() |
07 | local clone = player.Character:Clone() |
09 | clone.Parent = game.ReplicatedStorage |
10 | clone.Name = random.. " player" |
12 | player.Character:Destroy() |
14 | repeat wait() until not player.PlayerGui.Intro.Develop |
16 | local backClone = clone:Clone() |
17 | backClone.Parent = game.Workspace |
18 | backClone.Name = player |
And I have this error:
1 | Workspace.Script: 9 : attempt to index local 'clone' (a nil value) |
Ok, so, what's happening? It says I didn't define the 'clone' variable on line 9, but I did, on line 7!