ok well in that case how am i supposed to have everyones ui be the same serverwide
If you have a victory screen, for example. Just FireAllClients via remote Event and let the local script display the victory screen.
Or if it is a leaderboard or something else with data, pass the data though to the client and let the local script render it.
i figured id have to do remote events uggggggggggh
just before i try anything and mess it up (im stupid) could i have a remote event fire that just changes text and have the text be the parameter
is that the simplest way for me to do this
just one remote event
(my goal is to change gui text for everyone)
i guess thered be a timer too but you know
If it is only a string you’re passing, do what @kilesix suggested with the Number Value, but instead use a StringValue.
But if you want to expand your knowledge and scale your code with more data, Remotes are the way to go.
wouldnt remote events just remove the middle man tho
oh but then again if someone joined the game late then the text wouldnt appear for them
so how do i do this, just have the server script change the string value and have the local scripts constantly changing the text label to the text of the string value…?
So then you can make a new remote event for when a player joins, and if it fires, then disable the Gui.
With the RemoteEvent you would send the current state when the player joins, or when the player asks for it, do this if you’re comfortable with remotes. Otherwise I would use ValueBase | Roblox Creator Documentation in ReplicatedStorage, you can get the current state simply with just .Value, and you can listen to when the state changes with .Changed:Connect(). Same concept as what I posted earlier with the timer example.
for i,v in pairs(game:GetService("Players"):GetPlayers()) do
v.PlayerGui.ScreenGui.Frame.TextBox.Text = i
end
( you can modify playergui on the server )
As stated before by me, change the Gui itself from a NORMAL script, under ServerScriptService. Changing the text would be easy, add this into the Script in ServerScriptService:
local TimerValue = 100
----------------------
local TimerGui = Instance.new("ScreenGui", game.StarterGui)
TimerGui.Name = "TimerGui"
--------------------------
local TimerText = Instance.new("TextBox", TimerGui)
TimerText.Text = tostring(TimerValue)
----------------
while wait(1) do
TimerText.Text = tostring(TimerValue - 1)
if TimerText.Text == 0 then
break
end
This should work, let me know if not.
StarterGui would require all players to restart to see the GUI instead,
for i,v ipairs(game.Players:GetPlayers()) do
--clone text to playergui whatever
-- also, playergui is v.PlayerGui
end
It would change for all players.