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

Attempt to index nil with 'Clone'? [SLOVED]

Asked by 5 years ago
Edited 4 years ago

I have been making a remake of the undead coming, since it's broken but I got a error in my script, saying attempt to index nil with 'Clone'.

Please help me...

Here's the script:

01function giveWeapons()
02    local player = game.Players:GetChildren()
03    if(#player>0)then
04        for p = 1, #player do
05            if(player[p].TeamColor==hum_team.TeamColor)then
06                weapons.Pistol.Value:Clone().Parent = player[p].Backpack
07            end
08        end
09    end
10end

Thanks a lot, notreallysupernova

1 answer

Log in to vote
0
Answered by 5 years ago

You are trying to clone a value and not an object.

Ad

Answer this question