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

Why am I still having trouble getting a gui to pop up on command?

Hi I have asked a few questions about this gui that I have been trying to get to open when prompted to by a serverscript. I have been told to use remote events and the playerGui, both of which I am doing, but still with no luck. I am not getting any error messagaes but all of my prints throughout my script are running so I am guessing it is something wrong with either my local or server script.

Server Script

local t1 = game.Teams.T1
local t2 = game.Teams.T2
local t3 = game.Teams.T3
local t4 = game.Teams.T4
local zoneBind = game:GetService("ReplicatedStorage").ZoneBind
local guiStart = game:GetService("ReplicatedStorage").TeamGuiStart

while true do
	
--wait for players	
	while true do
		wait(5)
		contestants = {}
		for _, player in pairs(game.Players:GetPlayers()) do
			if player and player.Character then
				local humanoid = player.Character:WaitForChild("Humanoid")
				if humanoid and humanoid.Health > 0 then
					table.insert(contestants, player)
				end
			end
		end
		if #contestants == 1 then
			break
		end
	end
--open screen gui
	print("The")
	guiStart:FireAllClients()
	print("Lazy")
--zones run 
	zoneBind:Fire()
	print("Dog")
--victor shown
	while true do
		wait(5)
		
	end
	print("Jumped")
--return to lobby
	
--wait intermission
wait(30)
end

I'm not done with it yet, the part that isn't working is the line~~~~~~~~~~~~~~~~~guiStart:FireAllClients()


Local Script

local event = game:GetService("ReplicatedStorage").TeamGuiStart

function teamFrameOn() local teamFrame = game.Players.LocalPlayer.PlayerGui.GUI teamFrame.Enabled = true end

event.OnClientEvent:connect(teamFrameOn()

I really don't know the problem when I launch a test and go into my player's playerGui and enable the GUI like this script should be doing it brings the gui up so I'm guessing that's the problem. Thank you! (P.S. I might ask a few more questions today as I promised my partner I would be done with my part by today, Thank you to everyone on the site for being so helpful.)

1 answer

Try this at line 28, server script

local plrs = game.Players:GetChildren()
for i = 1, #plrs do
	event:FireClient(plr[i])
end

9 comments

0

It didn't work. I had the same result

0

what does the output says?

0

The Lazy Dog lol

0

then try making a "for i,v in pairs loop" at line 28, server script

0

I did this for i,v in pairs do guiStart:FireAllClients() end and now im getting an error saying 10:16:54.505 - ServerScriptService.MainScript:28: bad argument #1 to '(for generator)' (table expected, got nil)

0

I edited the answer.

0

still nothing :(

0

Thank you so much for helping though man I really appreciate it. I guess I'll just change the order of the loop if that's what I have to do.

0

glad i helped you :D

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