Activated is an event. You can :Connect() to it,* but it is not a boolean. (This code will always run If you want to keep track of whether it's activated or not, you can set a value whenever it's Activated or Deactivated.
* You just connect to an event by doing event:Connect(function), so an example would be
local myFunction(thingThatGotItsAncestryChanged, newAncestor)
print("how'd " .. thingThatGotItsAncestryChanged .. " get into " .. newAncestor)
end
local x = game.AncestryChanged:Connect(myFunction)
You can find more information on events here, the wiki has some good information on them. ("Discussion" is the important part since you don't need to disconnect anything, just connect.)
Edit: Another thing to note is that when you connect a function to a connection, it will always be connected unless directly disconnected (or the object of the event is destroyed since there's not going to be anything firing the event). This means that your current code will always check for when the handle is touched, even if the mouse button is no longer being held down. You can only stop an event by :Disconnecting it, meaning you should check inside the connected Touched function whether your mouse button is being held or not. (Preferable to do this by checking the variable that you're changing whenever a tool is activated or deactivated; disconnecting and reconnecting whenever the mouse button is pressed and unpressed is probably not very efficient.)
Edit 2: Edited the edit for clarification.
1 comment
If you have any more code, care to show it? Add print() in areas, it's helpful.