Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

mouse target or mouse hover?

is it better to raplace this code with "MouseHoverEnter" and "MouseHoverLeave"?


playersmouse.Move:connect(function()

local target= playersmouse.Target
local ppost=part1.Position
local part2= game.Players.LocalPlayer.Character:WaitForChild("Torso").Position
local magnitudes =(ppost-part2).magnitude	
		if (target) then
			if(target==part1)then
					if(magnitudes<10)then
						mouseover.Visible=true
						else
						mouseover.Visible=false
					end
			else
				mouseover.Visible=false	
			end
		end
end)

3 comments

0

Yes, thatd be the most efficient way to do the function.

0

whats the difference preformance wise?

0

Its basically the same tbh.

1 answer

Mouse.Hover is used when a mouse HOVERS a GUI(Any type). Mouse.Target is the object the mouse is pointing at. Thats the diference and if you don't use them correctly ur script will not work.

This discussion is preserved as it was. New answers, comments, and votes are closed.