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)

2 comments
That's strange, I put this exact code inside of a ServerScript and a LocalScript - but in PlayerGui and it works. "Make sure it's inside of the player somewhere" Is the only help I can provide.
FYI, if you're not in Play Solo, you need to be in a LocalScript to use RenderStepped. I recommend having 'print' statements throughout the script to make sure that it's running, that 'Mouse' exists, and that RenderStepped is firing.