This is a very simple mistake I must be missing.. I am trying to make to when the mouse's target is not nil then, it prints 'a'
--// I get the mouse and other vars up here game:GetService('RunService').RenderStepped:Connect(function() local XPos = Mouse.X local YPos = Mouse.Y if Mouse.Target ~= nil then print'a' end end)
Yea RenderStepped can do that sometimes, in my experience I could only have RenderStepped in one place, adding it in more than one place would cause one of them to not work or some other unexpected thing happen.
Instead of doing that why would check only when your mouse is moving, it would be more efficient too.
local mouse = game.Players.LocalPlayer:GetMouse() mouse.Move:connect(function() local XPos = mouse.X local YPos = mouse.Y if mouse.Target ~= nil then print'a' end end)