Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

--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)

2 comments

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.

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".

This discussion is preserved as it was. New answers, comments, and votes are closed.