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

How do change all players gui inside a normal script? without using remote functions [Not Answered]

How do change all players gui inside a normal script?

How do i change all players playergui using a normal script in the workspace. I wan't to change the text of the textlabel for all players, The location of what i wanna change StarterGui.ScreenGui.TextLabel.Text.

P.S if possible i don't wanna use remote functions. But else something like this. --edited

while true do

	local players = -- refers the variable for all players

	for i = 1, 30, - 1 do
		players.PlayerGui.ScreenGui.Textlabel.Text = i
		if i == 0 then
			break
		end
	end

end

7 comments

0

is that even possible?

0

Yes, it is.

0

You should use FireAllClients(). For a timer of only 30 seconds, firing every second wouldn't be that expensive (if you're worried about lag). I'm also confused on why you have a for loop inside a while loop with no wait() in either.

0

don't worry its just an example its not the script i have, by the way what do you mean by "You should use FireAllClients(). For a timer of only 30 seconds".

0

do you mean i need do something like this : (line1) for i = 1, 30, - 1 (line2) workspace.event:fireallclients(i) (line3) wait(1) (line4) end

0

then on the local script is like (line1) workspace.event.OnClientEvent:Connect(function(i) (line2) script.Parent.text = i (line3) end

0

FireAllClients is basically saying FireClient to every player in the game

1 answer

You should use RemoteEvents that connect to the client. From there you should :FireAllClients() and change the GUIs from the client.

1 comment

0

Sorry i need to change it from the server script.

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