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
01local Players = game:GetService("Players")
02local player = Players.LocalPlayer
03local playerGui = player:WaitForChild("PlayerGui")
04 
05script.Parent.HoverDetect.MouseHoverEnter:connect(function(Player)
06 
07    playerGui.InteractorNote.Frame.InteractInfo.Text = "Ay"
08 
09 
10end)
11 
12 
13script.Parent.HoverDetect.MouseHoverLeave:connect(function(Player)
14 
15    playerGui.InteractorNote.Frame.InteractInfo.Text = " "
16 
17end)

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)

01script.Parent.HoverDetect.MouseHoverEnter:connect(function()
02 
03    playerGui.InteractorNote.Frame.InteractInfo.Text = "Ay"
04 
05 
06end)
07 
08 
09script.Parent.HoverDetect.MouseHoverLeave:connect(function()
10 
11    playerGui.InteractorNote.Frame.InteractInfo.Text = " "
12 
13end)
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