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

How to refresh the starter Gui?

Hello, thanks for your coming. My problem is that I am trying to change a text label when the player touches the part, but when the player touches the screen GUI will not change. I found out that the text will only change and refresh after the player dies. So what should I do?

2 comments

0

You should edit the players gui instead of the starter gui. StarterGui is where gui's are stored to be replicated to a player on spawn, so yes editing them will take until player dies to refresh. However inside game.Players.LocalPlayer is PlayerGui (player.PlayerGui) and is the exact same as StarterGui, except it displays what the player currently has. Editing those will refresh instantly.

0

local TextLabel = game.Players.LocalPlayer.ScreenGui.TextLabel instead of local Textlabel = game.StarterGui.ScreenGui.TextLabel

1 answer

✓ Accepted answer

basically what the comments said. Change the player player GUI. Then you would change the text from there. Such as:

script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.PlayerGui.ScreenGui.TextLabel.Text = “Your Text Here”
      end
end)

1 comment

0

If it works, please tell me and accept my answer. If it doesn’t I’ll see what I can do

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