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

I got a interesting question about mouse position?

Asked by 7 years ago

So im trying to make a script that shows the Y mouse position in first person so i can make a if to see how high up the mouse is so i can make arms only follow up to a certain point into air thanks for any answers. heres the idea of the script i just need the method

if (some mouse position cordinate for y) <= limit then

randomfunction()

end

1 answer

Log in to vote
0
Answered by
thesit123 509 Moderation Voter
7 years ago

First you should get the players' Mouse: local Mouse = game.Players.LocalPlayer:GetMouse() and use Mouse.Y to get the Mouse Y position. Note that 0 might be at the top of the screen.

Example code, Also note that you should do a loop or anything to check the Y at a period of time:

local Mouse = game.Players.LocalPlayer:GetMouse()

if Mouse.Y <= limit then
    -- randomfunction()
end

Here is the raw version:

local Mouse = game.Players.LocalPlayer:GetMouse()

if Mouse.Y <= limit then

randomfunction()

end

0
that dont work in first person lawahh19 2 — 6y
Ad

Answer this question