Destroying is not working?

So I am trying to reset the player mouse icon when the tool gets destroyed.

When the player dies, the destroying event does not fire.

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local tool = script.Parent.Parent

local mouseIcon = icon

tool.Equipped:Connect(function()
	mouse.Icon = mouseIcon
end)

tool.Unequipped:Connect(function()
	mouse.Icon = ""
end)

tool.Destroying:Connect(function()
	print("Destroyed") -- does not print
end)
1 Like

Destroying needs to be triggered by :Destroy() attempting to delete the tool with the roblox studio Delete function will not fire it.

So would I do character.Destroying?

No, to test .Destroying while testing, just use this on command bar (server-sided, switch to server testing)
game:GetService("Players").GameMaster4268.Character:FindFirstChildOfClass("Tool"):Destroy()

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