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

How can I get in touch with PlayerGui for my textlabel?

Asked by 6 years ago
Edited 6 years ago
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

script.Parent.HoverDetect.MouseHoverEnter:connect(function(Player)

    playerGui.InteractorNote.Frame.InteractInfo.Text = "Ay"


end)


script.Parent.HoverDetect.MouseHoverLeave:connect(function(Player)

    playerGui.InteractorNote.Frame.InteractInfo.Text = " "

end)

This is my current script. I want the Text setup in playerGui to change the text, but even without MouseHoverEnter it doesn't change. This is in a local script. I think my problem is that playerGui isn't being called right, but can anyone know what's wrong for sure?

1 answer

Log in to vote
0
Answered by 6 years ago

--in textlabel/button or whatever (localscript)

script.Parent.HoverDetect.MouseHoverEnter:connect(function()

    playerGui.InteractorNote.Frame.InteractInfo.Text = "Ay"


end)


script.Parent.HoverDetect.MouseHoverLeave:connect(function()

    playerGui.InteractorNote.Frame.InteractInfo.Text = " "

end)
0
oops, forgot to edit the middle lines. your script is almost correct, i just believe your directories are incorrect to the InteractInfo. go off of script.Parent for these. getzedotus 0 — 6y
0
I don't know what your answer is. The directories are correct according to the explorer. I just don't know if "playerGui" is actually calling "playerGui". BloxaBrick 2 — 6y
Ad

Answer this question