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

Why is the mouse's position not printing when I click?

Asked by
obcdino 113
6 years ago

When you equip a tool, every click's position is supposed to be printed, but it doesn't, and no error comes up?

This is inside a LocalScript inside a tool.


script.Parent.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() print(mouse.Hit.p) end) end)
0
Does the tool have a Handle? KingLoneCat 2642 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

Hey obcdino,

I think the reason that your tool isn't printing the mouse's position is because the tool doesn't have a handle. For whatever reason, Roblox decided to make their tool API like this, so if you want to confront somebody about this, just ask them. But yeah, that is why your mouse's position isn't printing. You just need to put a Part inside the tool, and give it the name "Handle".

I hope I helped, and have a nice day.

~~ KingLoneCat

0
I don't think any of tool's events get activated unless it has a Handle... KingLoneCat 2642 — 6y
0
Thank you for the answer, but why is the API like this? obcdino 113 — 6y
0
you can set the property RequiresHandle to false or use a HopperBin if you dont wish to use a handle fanofpixels 718 — 6y
0
^ HopperBins are deprecated. TheeDeathCaster 2368 — 6y
Ad

Answer this question