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

Is there anyway to check the placement (mouse)?

Asked by
roquick 41
6 years ago

is there anyway to check if a players mouse is touching a brick? I don't mean like clicking a brick, I mean like a mouse that is within the bricks pixel positions on the players screen. sorry if its hard to explain

0
try using a click detector, with no reaction. FlippinAwesomeCrew 62 — 6y
0
Dont use a click detector... GingeyLol 338 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

If you don’t want any click detectors then you can put this in a local script inside of starter player scripts:

While wait(1) do
      if game.Players.LocalPlayer:GetMouse().Target.Name == “fill in” then
            -- do what you want
      end
end

Hope I helped.

Ad
Log in to vote
0
Answered by
Vulkarin 581 Moderation Voter
6 years ago
Edited 6 years ago

Like FlippinAwesomeCrew said you can use the event of a ClickDetector MouseHoverEnter

workspace.Part.ClickDetector.MouseHoverEnter:Connect(function(player)
    print(player.Name.." has mouse over brick!")
end)

Edit: Should you need to check if the mouse is there at a random point of time and don't want an actual event then you can use the property of Mouse Target

0
thank you roquick 41 — 6y

Answer this question