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

GUI not showing for all players, why is it only for one player?

Hi, and thanks for seeing my question! I've had a lot of problems figuring this out, It is getting on my nerves that I can't quite figure this out. Basically, I have this GUI stored in StarterGui, The GUI is then copied over by this script that isn't Local.

game.Players.PlayerAdded:connect(function(player)
local main = game.ReplicatedFirst.main:clone()
main.Parent = player.PlayerGui
main.Enabled = true
end)

These scripts are all in ServerScriptService, then I have a 'main' script located in ServerScriptService that is too, not local.

for i,player in pairs (game.Players:GetChildren()) do
for i = 1,10 do
	wait()
player.PlayerGui.main.blackout.BackgroundTransparency = player.PlayerGui.main.blackout.BackgroundTransparency - .1
end

This is basically getting everyone in the players then getting their already copied over GUI to display a blackout effect. But It only appears on 1 players screen, I've had so much trouble figuring this out. Any help is dearly appreciated and I hope you're able to help! Thanks for reading my question!

Game is filtering enabled.

1 comment

0

Use remote events

1 answer

✓ Accepted answer

In a FilteringEnabled, non-experimental game, the clients have to go through "server authorization" to change anything not on their client; therefore, you will have to make a RemoteEvent on the server.

(Untested)

Server script:

local event = game.Workspace.RemoteEvent;

-- do whatever needs done before the blackout

event:FireAllClients();

-- do after stuff

Local script (in the Gui):

local event = game.Workspace.RemoteEvent;

event.OnClientEvent:connect(function()
	for a = 1, 10 do
		script.Parent.blackout.BackgroundTransparency = script.Parent.blackout.BackgroundTransparency - 0.1;
		wait();
	end
end)

Also worth noting is that Guis in StarterGui are copied to each client's PlayerGui automatically

1 comment

0

Thank you!

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