I have a script and I want it to give the player a gun if they don't have one already. However when ever I run the script I get an error saying attempt to index local 'p' (a nil value). Here is my code.
while true do
local p = game.Players.LocalPlayer
if p.Backpack.AK-47 ~= nil then
local tool = game.ServerStorage.AK_47:Clone()
tool.Parent = p.Backpack
end
wait(1)
end
I would really love some help
