my friend made this for me and it says on the output that raygun doesnt exist.
so how would u do this that if u dont have the gun in ur backpack then it clones it in there.
thanks,
blackknight
function onTouch(part)
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player.Backpack.Raygun == nil then
gun = game.Lighting.Raygun:clone()
gun.Parent = player.Backpack
end
end
script.Parent.Touched:connect(onTouch) |