The Text won't show

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Make the text show on the gui

  2. What is the issue? Include screenshots / videos if possible!
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried FireAllClients()

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Server Script

-- Start Variables
local MinigameChoose = script.Choose.Value
local EnoughPlayers = false
local StartRound = true
local EpicCheck = false
local PlayerCount = 0
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local events = ReplicatedStorage:WaitForChild("events")
-- Check Players
game.Players.PlayerAdded:Connect(function()
	PlayerCount = PlayerCount + 1
	print(PlayerCount)
end)
game.Players.PlayerRemoving:Connect(function()
	PlayerCount = PlayerCount - 1
	print(PlayerCount)
end)
while true do
	wait(1)
	if PlayerCount == 2 then
		EnoughPlayers = true
	elseif EnoughPlayers == true  then
		if EpicCheck == true then
			events.intermission:FireAllClients(PlayerCount)
		EpicCheck = false
		end
	end	
end

local script

-- Variables
local ReplicatedService = game:GetService("ReplicatedStorage")
local events = ReplicatedService:WaitForChild("events")
local event1 = events.intermission
local event2 = events.statusFail
local sec = 60

-- Intermission

event1.OnClientEvent:Connect(function(PlayerCount)
	repeat wait(1)
		if PlayerCount >= 2 then
		sec = sec - 1
		script.Parent.Text = ("Intermission : "..sec)
		elseif PlayerCount <= 2 then
		script.Parent.Text = ("Not enough Players to begin, Invite your Friends!")		
		end
	until sec == 0
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

I don’t fully understand exactly what the problem is or where the code is going wrong.

2 Likes

You can simplify a lot of your existing code by reading from the NumPlayers property of Players, or by using the following line of code:

if #game.Players:GetPlayers() >= 2 then
--//two or more players in game
end

With that said, I’m noticing you have a conditional statement for the PlayerCount parameter in your client code. However, that value will never change once called by the server. It is passed by value alone.

I would recommend setting the value of a StringValue from the server with the message you want to broadcast to all clients in the game. Then, your client code would be something like this:

local msg_value = game.ReplicatedStorage:WaitForChild("GameMessage") --//Path to some StringValue

script.Parent.Text = msg_value.Value

msg_value:GetPropertyChangedSignal("Value"):Connect(function()
script.Parent.Text = msg.Value --//Update the text when ever the ValueObject's value is changed
end)

This is a much simpler and more reliable approach to display a game status message to all clients. And with this system implemented, you can easily change the value of the StringValue from your server-sided game script depending on how many players are in the game. :slight_smile:

Hope this helps!