My other question got taken down because some kid reported it for no reason.My script won't work I tried fixing it on my own and it still won't work. Please help. Thanks. Also, here's more details i'm trying to do is when a player touches the brick he/she will get a gear. Here's the script.
local spam_prevention = false
script.Parent.Touched:connect(function(hit)
print
IsPlayer = hit.Parent.Parent:FindFirstChild("Humanoid")
if IsPlayer ~= nil then
if spam_prevention == false then spam_prevention = true end
Tool_To_Give = game.Lighting.Dynamite:Clone()
player_ = game.Players[hit.Parent.Parent.Name]
Tool_To_Give.Parent=player_.Backpack
wait(1)
spam_prevention=false
end
end)
Thanks
:NOTE I don't want a replacement of this script I just want help. Also, I didn't free model it. If anyone in the comments say I did don't listen to them they're just haters. Bye! :)

1 comment
Please approve the answer below!