Why wont it give the tool?

Hi, I have a simple script that is supposed to give you a tool. But it isn’t working. The script is inside a part in replicated storage. The part gets duplicated and put into workspace. I have done this before, but for some reason it isnt working.

local pr = script.Parent.ProximityPrompt
pr.Triggered:Connect(function(player)
		local clone = game.ReplicatedStorage.Tools.Pizza:Clone()
		clone.Parent = player.Backpack
end)

pr.Triggered:Connect(function()
	script.Parent:Destroy()
end)

Your 2nd Connection is overwriting the first one I believe, or the 2nd connection is running first. I would just remove that and it should work fine

local pr = script.Parent.ProximityPrompt
pr.Triggered:Connect(function(player)
    local clone = game.ReplicatedStorage.Tools.Pizza:Clone()
    clone.Parent = player.Backpack
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.