This script was suppose to do is. When the player touches the brick he/she will get dynamite in their inventory (I DON'T WANT ANYONE TO REMAKE THIS SCRIPT ALL I NEED IS HELP TO FIX IT) Thanks!

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() --Change "Dynamite" to what tool you want to be given
player_ = game.Players[hit.Parent.Parent.Name]

Tool_To_Give.Parent=player_.Backpack
wait(1)
spam_prevention=false
end
end)

1 comment

0

You're bad at hiding the fact you're taking free models. Take a look at line 8.