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

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

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

✓ Accepted answer

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

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