I've already made it so when a player clicks on a part they get a tool, but I want to make it so every time they click the part they get the same tool. Right now you can only click on it once and afterwards you can't click to get the tool anymore.
local dirt = script.Parent local bagOfDirt = game.ReplicatedStorage["Bag of Dirt"] local decal = dirt.dirty.Decal dirt.ClickDetector.MouseClick:Connect(function(hit) if hit then bagOfDirt:Clone() bagOfDirt.Parent = hit.Backpack end end)
i see the issue, you're cloning the bag of dirt but not doing anything with the clone, so you're just taking the tool, instead, add a variable to the clone to make it work correctly
local dirt = script.Parent local bagOfDirt = game.ReplicatedStorage["Bag of Dirt"] local decal = dirt.dirty.Decal dirt.ClickDetector.MouseClick:Connect(function(hit) if hit then local tool = bagOfDirt:Clone() tool.Parent = hit.Backpack end end)
I figured it out, haha. I was making the actual dirt bag tool go from replicated storage to the player and not the clone, so it would only work once.