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 4 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:

function giveWeapons()
    local player = game.Players:GetChildren()
    if(#player>0)then
        for p = 1, #player do
            if(player[p].TeamColor==hum_team.TeamColor)then
                weapons.Pistol.Value:Clone().Parent = player[p].Backpack
            end
        end
    end
end

Thanks a lot, notreallysupernova

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question