Currently the tool is only destroyed for the player who clicks it.
localscript
local tool = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local HungerValue = player:WaitForChild("Stats").Hunger
local ThirstValue = player:WaitForChild("Stats").Thirst
local anim = hum:LoadAnimation(script.Parent.Animations:WaitForChild("Animation"))
local parts = tool.Parts:GetChildren()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage.Remotes:WaitForChild("FoodEvent")
amount = 2
playing = false
debounce = false
tool.Activated:Connect(function()
if amount == 0 then
tool:Destroy()
else
if playing == false then
playing = true
anim:Play()
amount = amount - 1
ThirstValue.Value = ThirstValue.Value + 5
HungerValue.Value = HungerValue.Value + 5
if HungerValue.Value > 100 then
HungerValue.Value = 100
end
if ThirstValue.Value > 100 then
ThirstValue.Value = 100
end
wait(2)
playing = false
if amount == 0 then
debounce = true
end
end
end
end)
local function dequip()
for _,parts in pairs(parts) do
parts.CanCollide = true
end
end
local function equip()
for _,parts in pairs(parts) do
parts.CanCollide = false
end
end
if debounce == true then
Event:FireServer(tool)
end
tool.Equipped:Connect(equip)
tool.Unequipped:Connect(dequip)
Normal script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage.Remotes:WaitForChild("FoodEvent")
local function onCreatePartFired(tool)
wait(0.25)
tool:Destroy()
end
Event.OnServerEvent:Connect(onCreatePartFired)

1 comment
Im not sure but try to make game.Workspace.Starterpack.Tool:Destroy() if you want it to dissapear btw change tool to the correct name and the location too