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
hmmm, maybe you should check if its printing "NULL". Sorry man. Good luck