So I am trying to make an efficient script to prevent 'lag', here it is:
local Last = nil
Mouse.Move:connect(function()
if Mouse.Target ~= Last and Mouse.Target ~= nil then
Last = Mouse.Target.Parent
print(Last)
end
end)
When I change 'Last = Mouse.Target' it doesn't spam the console but when I change it to '..Target.Parent' it spams the console with 'Workspace' not sure why as it is the same as 'Last' so it shouldn't..?

1 comment
i dont know what you are using this script for but a debounce will help e.g. stop excessive requests to script