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

Mouse GUI will not turn Visible. Can someone help?

trying to make a LocalScript to make a GUI popup utilizing the Target property of the mouse. Can someone help?

workspace:WaitForChild(game.Players.LocalPlayer.Name)

player = game.Players.LocalPlayer

cursor = player:GetMouse()

cursor.Move:Connect(function()
	
	local gui = player:WaitForChild("PlayerGui"):WaitForChild("Cursor"):WaitForChild("FollowCursor")

	if cursor.Target ~= nil then
		
	local target = cursor.Target
	
	local tName = target.Name
	
	gui.Visible = true
	gui.Text = tName
	
	print(tName)

	gui.Position = UDim2.new(cursor.X + 5, 0, cursor.Y, 0)
		
	else
		
		print("NULL")
		
		gui.Visible = false
	
	end

end)
 

1 comment

0

hmmm, maybe you should check if its printing "NULL". Sorry man. Good luck

1 answer

FIXED the mouse positioning was off the screen. In the words of the greats: "Oof"

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