--On a server script
local remoteEvent=game.ReplicatedStorage.W--Get the adress of your remote event here, it allows communication between server and client
local function decideWinner()
local northTeamPoints=0
local southTeamPoints=0
local Winner
for _,player in pairs(game.Players:GetPlayers()) do
if player.Team==game.Teams.North then
northTeamPoints += player.leaderstats.Value.Value
elseif player.Team==game.Teams.South then
southTeamPoints +=player.leaderstats.Value.Value
end
end
if northTeamPoints>southTeamPoints then
remoteEvent:FireAllClients(game.Teams.North)
elseif southTeamPoints>northTeamPoints then
remoteEvent:FireAllClients(game.Teams.South)
elseif southTeamPoints==northTeamPoints then
remoteEvent:FireAllClients(nil)
end
end
while wait(3) do
if game.StarterGui.TopText.Time.Text == "Deciding Winner..." then
decideWinner()
end
end
Instead of a string you should check a value or just do the logic in the while loop
local IntermissionTimer=15 --You can hard code this
local gameTimer=600
while true do --Infinite loop, never ends
--Intermission logic here
wait(intermissionTimer)
--Game starts
wait(gameTimer)
--Game Ends
decideWinner()
end
Iâm on mobile so canât type correctly the code here
if teamBlue.Score > teamRed.Score then
-- display it
elseif teamBlue.Score < teamRed.Score then
-- display it
elseif teamBlue.Score == teamRed.Score then
-- display it
end
When you are testing, already pressed the play button there is a button to switch between them, a local server is just a Roblox server but in your computer to test with multiple players