So I have to change my 'StatusGui' multiple times, as I can't change gui's whilst Filtering Enabled is true, I'm using multiple functions to fire the same event. First of all is firing the same Remote Event again possible? Keep in mind that I'm using a module script (if that changes anything) and I'm using another script to run the functions althought when the Gui is changed into server loaded there is no function for it. I've tried to do it like this:

Module Script :

local changeStatus = game.ReplicatedStorage.Events.ChangeStatus
changeStatus:FireAllClients('Server Has Loaded...')

module.WaitForPlayers = function(minPlayers)
	numPlayers = serverStorage.ServerValues.NumPlayers
	while numPlayers.Value < minPlayers do
		wait()
		changeStatus:FireAllClients('There needs to be atleast ' .. tostring(minPlayers) .. ' players.')
		-- statusValue.Value = 'There needs to be atleast ' .. tostring(minPlayers) .. ' players.'
	end
end

**Local Script : **


local replicatedStorage = game:GetService('ReplicatedStorage')
local serverStorage = game:GetService('ServerStorage')

local player = script.Parent.Parent.Parent

-- local statusValue = replicatedStorage.StatusValue I currently don't need this because of FE.
local statusLabel = player.PlayerGui:WaitForChild('StatusGui').StatusFrame.StatusLabel
local changeStatus = game.ReplicatedStorage.Events.ChangeStatus

changeStatus.OnClientEvent:connect(function(text)
	statusLabel.Text = tostring(text)
end)

6 comments

0

Do you ever call the WaitForPlayers function?

0

I'll second that; you don't appear to actually call your WaitForPlayers function. You should also consider using WaitForChild, even for children in ReplicatedStorage which should already be replicated by the time the script is run. It's good practice.

0

I've made another function on top of this, it uses the :IsLoaded() method on the Data Model. So I'm not using 'WaitForChild' because I already optimized my game so I don't have to. Either way I'll try using it.

0

You still didn't answer our question.

0

Wait For Child isn't the problem. I know this because it has worked when I call the event to say 'Server Loaded', so it must've loaded already

0

^ The gui said server loaded btw.