Tool Touch Event


I have a weapon spawner but want to stop players from picking it up more then once, I think my code below is correct to find if the player has Gun1 in thier backpack but how do you intercept the tool pickup event to allow or stop the pickup?

local tool = hit.Parent:FindFirstChild("Gun1")
if tool then
   -- do stuff


Is there another script that gives them the gun?

No the player just gets it when they walk over the gun

Make sure to check in the backpack as well, not just the character. And if you haven’t already, use the piece of code you just posted within the script that gives the player the gun, if this isn’t working then posting the give script would help.

What script spawns the gun? The first piece of code isn’t enough information.