So I'm creating a script that takes the players tool once they stop touching a seat. Nothing is happening and I'm getting an output that says "attempt to index nil with "Backpack". It is not in a local script. Any help would be greatly appreciated!
local deBounce = false
local function takeRocket(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if deBounce == false then
deBounce = true
wait(1)
local rifle = player.Backpack.AssultRifle
rifle:Destroy()
deBounce = false
end
end
script.Parent.TouchEnded:Connect(takeRocket)

1 comment
I used a different way but I'll still accept