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 7 years ago
Edited 7 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 7 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 — 7y
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 — 7y
Ad

Answer this question