Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I remove the player's tool once it's touched?

Asked by
yoshi8080 445 Moderation Voter
8 years ago

I wanted to make a fireplace that would need wood to keep the fire burning.

fuel = script.Parent.Parent.Fuel
--// Adds fuel once wood is added
function AddFuel(Tool)
if (Tool.Parent.Name == "Wood") then
fuel.Value = fuel.Value + 10
Tool.Parent.Handle:Destroy()
Tool:Destroy()
end
end
script.Parent.Touched:connect(AddFuel)

The script is a server script in a part, It works however, the tool is still in the player's backpack.

Answer this question