Tool doesn't fully delete after :Destroy() function (visible only on Server side)

I have a problem with a tool (ACS Drink), as the tool still remains in the Player’s parent, visible only on Server side, after the :Destroy() function.

image

Here’s the script that does the :Destroy()

local Tool = script.Parent
local Player = game.Players.LocalPlayer
local con = nil
local enabled = true

function onEquipped(mouse)
	con = mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

function onUnequipped(mouse)
	if con ~= nil then
		con:disconnect()
	end
end

function onButton1Down(mouse)
	if not enabled then
		return
	end
	
	enabled = false
	
	if Player.HungerVal then
		if Player.HungerVal.Value + 0 > 100 then
			Player.HungerVal.Value = 100
		else
			Player.HungerVal.Value = Player.HungerVal.Value + 0
		end
	end

	if Player.ThirstVal then
		if Player.ThirstVal.Value + 200 > 200 then
			Player.ThirstVal.Value = 200
		else
			Player.ThirstVal.Value = Player.ThirstVal.Value + 200
		end
	end
wait(2)
	Tool:Destroy()
end

Tool.Equipped:connect(onEquipped)
Tool.Unequipped:connect(onUnequipped)

I tried Tool.Parent = nul, Tool.hmm.Transparency = 1, doesn’t do anything.

well you are destroying the tool on the client, that isnt being replicated to the server cause well, you are doing it on the client. If you want to fully delete, delete it via a server script/regular script

1 Like

Oh ok, didn’t know that. Thanks.

2 Likes

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