Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Mouse GUI will not turn Visible. Can someone help?

Asked by 4 years ago

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)


0
hmmm, maybe you should check if its printing "NULL". Sorry man. Good luck Rynappel 212 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question