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

Trying to change screen gui text label how do you do it?

Asked by 4 years ago
Edited 4 years ago

im trying to change a text label on a screen gui in starter gui when you click a part

here is the code

local Textlabelforthingy = game.StarterGui.ScreenGui.TextLabel

script.Parent.ClickDetector.MouseClick:Connect(function()
Textlabelforthingy.Text = "the part has been clicked" end

0
can someone please help me QuestionableScript3r -6 — 4y
0
where is the player gui im new sorry QuestionableScript3r -6 — 4y
0
its when u playtest alexfinger21 341 — 4y
0
k now its working QuestionableScript3r -6 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago

Ok, so you don't use StarterGui, you use PlayerGui Here is the fix:

--Local Script.
local plr = game.Players.LocalPlayer
local Textlabelforthingy = plr.PlayerGui.ScreenGui.TextLabel

script.Parent.ClickDetector.MouseClick:Connect(function()
    Textlabelforthingy.Text = "the part has been clicked" 
end
Ad
Log in to vote
0
Answered by
DBoi941 57
4 years ago

It is because you are changing it in StarterGui you need to change it in the Player Gui

script.Parent.ClickDetector.MouseClick:Connect(function(player)
    local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel
    Textlabelforthingy.Text = "the part has been clicked"
end)
1
thank you QuestionableScript3r -6 — 4y

Answer this question