#GetMouse problem

22 messages · Page 1 of 1 (latest)

strong dagger
#

What's the problem.

#

What specifically

random topaz
#
local P = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RS = game:GetService("RunService")

local plr = P.LocalPlayer

RS.RenderStepped:Connect(function()
    local mousePos = UIS:GetMouseLocation()
    print(mousePos.X, mousePos.Y)
end)
#

i forgot about that ngl

#

but i rewrote whole thing so lemme just

#

i made it slightly better

#

ok i can try fixes with that

strong dagger
#

Oh yeah by the way

#

Mouse.Changed only fires when it's properties change.

random topaz
#

uhh so ig mine works then

#

let me make it not spam intensely

strong dagger
#

😭😭😭

random topaz
#

oh

#

do you uhh want a script with it i finished the thing so it dont spam

#

dw

strong dagger
#

And called me a piece of shit.

#

😔

random topaz
#

i tested this and it worked

local P = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local RS = game:GetService("RunService")

local plr = P.LocalPlayer

local lastMousePos = nil

RS.RenderStepped:Connect(function()
    local mousePos = UIS:GetMouseLocation()
    if lastMousePos == nil or mousePos.X ~= lastMousePos.X or mousePos.Y ~= lastMousePos.Y then
        print(mousePos.X, mousePos.Y)
        lastMousePos = mousePos
    end
end)
#

enjoy and cya

fallow axle
#

wot

#

bruh

#

looks like it should be a localscript, i'd start with putting it in somewhere that localscripts execute, like starterplayerscripts or startergui