✓ Accepted answer
Just change a few things..
local Tool = script.Parent
Tool.Activated:Connect(function()
print(“I am so happy”)
end)
Tool.Deactivated:Connect(function()
print(“awww man I so sad”)
end)
You needed to actually connect the event to the function, hints :Connect.
Though I've been testing, and that didn't work for me? But, if you run into any problems, use this, the script that worked for me. (this code is a localscript, child of the tool)
local tool = script.Parent
function check()
if tool.Parent == game.Players.LocalPlayer.Backpack then
print("Unequipped!")
elseif tool.Parent == game.Players.LocalPlayer.Character then
print("Equipped!")
end
end
tool.AncestryChanged:Connect(check)
There you go! 2 ways to do it! Good luck on whatever you're doing!
3 comments
Try replacing: Tool.Activated and Tool.Deactivated with Tool.Activated:Connect and Tool.Deactivated:Connect.
Ooh it worked, thanks, I would’ve upvoted your but it wasn’t an answer..
I'll post it right now.