I’ve been making a round-based game, and I’ve been stuck on a countdown.
For some reason, when more people join, the countdown doesn’t reduce and I cannot for the life of me find the issue.
Server script:
local PlayersToStart = 5
local TwoTimesGhostGamepassID = 6395460
local RE = game.ReplicatedStorage.RemoteEvent
local MPS = game:GetService("MarketplaceService")
math.randomseed(tick())
wait(1)
while true do
local PlayerCount = #game.Players:GetChildren()
if #game.Players:GetChildren()< PlayersToStart then
RE:FireAllClients("KeyWord",PlayersToStart - PlayerCount .." Player(s) needed to begin a round!",true)
Local Script:
local RE = game.ReplicatedStorage.RemoteEvent
local Player = game.Players.LocalPlayer
local Character = Player.Character
local TS = game:GetService("TweenService")
local FadeFrame = Player.PlayerGui:WaitForChild("UI_Holder").Fade
RE.OnClientEvent:Connect(function(Key,String,Bool)
if Key == "KeyWord" then -- Text Function
if Bool == true then
Player.PlayerGui.UI_Holder.Notification.Text = String
else
local TextAmount = string.len(String)
for i = 1,TextAmount do
local NewString = string.sub(String,1,i)
Player.PlayerGui.UI_Holder.Notification.Text = NewString
wait(.1)
end
wait(3)
Player.PlayerGui.UI_Holder.Notification.Text = ""
end
And help would be amazing! thanks!