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

How to refresh the starter Gui?

Asked by 3 years ago

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?

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. WizyTheNinja 834 — 3y
0
local TextLabel = game.Players.LocalPlayer.ScreenGui.TextLabel instead of local Textlabel = game.StarterGui.ScreenGui.TextLabel WizyTheNinja 834 — 3y

1 answer

Log in to vote
0
Answered by
Nozazxe 107
3 years ago

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)
0
If it works, please tell me and accept my answer. If it doesn’t I’ll see what I can do Nozazxe 107 — 3y
Ad

Answer this question