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

How to know if the position of the mouse is the sky's empty void?

Asked by 6 years ago
Edited 6 years ago

That's all there is, I'm just typing so I can post this question

1 answer

Log in to vote
0
Answered by 6 years ago

Really simple problem; If PlayerMouse.Target is nil then it's pointing at nothing; which is sky/void.

local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()

while wait() do
    if mouse.Target == nil then
        --if mouse is pointing to nothing
    else
        --if mouse is pointing to something
    end
end
  • You must put this in LocalScript to make it work.
Ad

Answer this question