So, today I was working on an “Announcement” System for a Court Roleplay. Anyways, how its supposed to work is, Judges should be able to run “!start” and the Announcement Label should change to the texts provided in the code but its not.
local startLabel = game.StarterGui.ThingySystem.ThingyLabel
local Judges = {"HonorableNolanC"}
Players.PlayerAdded:Connect(function(plr)
if plr == Judges then
plr.Chatted(function(message)
if string.sub(message, 1, #"!start"):lower() == "!start" then
startLabel.Text = "All rise for the honorable Judge," .. plr.Name
wait(5)
startLabel.Text = "You may be seated."
wait(5)
startLabel.Text = "Please be seated upon joining, the Honorable Judge" .. plr.Name .. "is presiding."
end
end)
end
end)```
You are not changing the GUI that’s in each client, you’re only changing the StarterGui, basically the template from where your GUIs get replicated to the client when they join.
Instead, set the variable for each client’s own GUI right after PlayerAdded.
Players.PlayerAdded:Connect(function(plr)
local startLabel = plr.PlayerGui:WaitForChild("YourGUINameHere")
-- This way we're targeting each player's already cloned GUI.
-- Rest of the code goes here
end)
You cannot make changes to anything in the StarterGui, rather, you can make changes to the things from StarterGUI that were replicated to the PlayerGui.
I’d recommend you doing this on the server with a remoteEvent but whatever.
You are changing the text of a TextLabel that is in StarterGui, StarterGui is like a template of what the client should clone to it’s PlayerGui. Making changes to StaterGui will not provide realtime edits to the objects already cloned to PlayerGui. In this case you’ll need to change the property of “ThingyLabel” in PlayerGui.