Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Function ":Activated()" of tool not working?

Asked by 7 years ago
script.Parent.Activated:Connect(function()
    print'hi'
end)

The print statement never prints. Any idea why?

1 answer

Log in to vote
1
Answered by 7 years ago

I may be wrong here, but i suppose the Tool doesn't have a Handle attached to it. If you insert a Script that attempts to call the .Activated event without a Handle, the event's connected function would never call. If you have a tool that has the property RequiresHandle to true, the tool must have a handle. If it's set to false, the tool wouldn't require a handle and the .Activated event would call normally.

0
The tool didn't have a handle and doesn't need any parts attached to it. When I set RequiresHandle to false it still didn't work. SchonATL 15 — 7y
0
Were any of the children of the Tool a BasePart? Cowation 50 — 7y
0
The little thing that you probably need to do is that script.Parent has to be the tool saSlol2436 716 — 7y
0
It HAS to be or else nothing would work. Cowation 50 — 7y
0
What I suggest you do is make sure and double check if any of the children of the Tool is a BasePart and make sure you refer to the tool and not something else in your code. If there are parts in your tool, you should name ONE 'Handle' and adjust it's grip. Also, what kind of tool are you making? This helps me determine whether you should use a Handle or not. Cowation 50 — 7y
Ad

Answer this question