Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I got a interesting question about mouse position?

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

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

1 comment

0

that dont work in first person

This discussion is preserved as it was. New answers, comments, and votes are closed.