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

Changing a gui text?

Asked by 10 years ago

Here is my atempt at changing a gui's text using a script

game.StarterGui.ScreenGui.Info.Text = "Intermission 9"

the problem is it doesnt change the text, probly an easy fix for some but im a noob with lua, please help, thanks.

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

Your problem is that you're trying to change the gui's text from the StarterGui's gui. When in-game, the gui that you see is stored in your PlayerGui. When a player joins, all guis from StarterGui get cloned into your PlayerGui.

So to fix? Access the gui from your PlayerGui.

This should be used in a localscript;

local plr = game.Players.LocalPlayer --Get the player
local gui = plr.PlayerGui.ScreenGui.Info --Get the gui

gui.Text = "Intermission 9" --Change the text
Ad

Answer this question