#Trouble with round system
1 messages · Page 1 of 1 (latest)
The code isnt sending
Its saying "Your message could not be delivered. This is usually because you don't share a server with the recipient or the recipient is only accepting direct messages from friends. You can see the full list of reasons here"
local GameStatus = game.ReplicatedStorage.GameStatus
local IntermissionTime = 5
local Maps = game.ServerStorage.Maps:GetChildren()
GameStatus:GetPropertyChangedSignal("Value"):Connect(function()
if GameStatus.Value == "Intermission" then --Checks to see if the game is in the intermission phase
for i = IntermissionTime, 0, -1 do --Counts down
print(i)
if i == 0 then --If there is more than 1 player, the game moves on to map selection phase
if game.ReplicatedStorage.PlayersCount.Value > 1 then
GameStatus.Value = "MapSelection"
else
print("Not Enough Players")
end
end
task.wait(1)
end
end
end)
GameStatus:GetPropertyChangedSignal("Value"):Connect(function()
if GameStatus.Value == "MapSelection" then
print(GameStatus.Value)
task.wait(5)
local MapNumber = math.random(1, #Maps) --Picks a random number between 1 and the amount of maps in the Maps Folder
if game.ReplicatedStorage.PlayersCount.Value > 1 then --Makes sure there is more than 1 player in the game before starting game
local MapChosen = Maps[MapNumber] --Chooses the map based on the number generated
local Map = MapChosen:Clone() --Clones the map that was chosen
Map.Parent = game.Workspace
GameStatus.Value = "Game" --Puts the map in the workspace, then sets the game's phase to Game
end
end
end)
GameStatus:GetPropertyChangedSignal("Value"):Connect(function()
--print(GameStatus.Value)
if GameStatus.Value == "Game" then
print("Game Started")
local PlayersInRound = game.Players:GetChildren() --Make a table for the players in the round
print(PlayersInRound)
wait(1)
while GameStatus.Value == "Game" do
if #PlayersInRound <= 1 then --If there is 1 or no players left than the game's phase goes to intermission
GameStatus.Value = "Intermission" --Isnt working so far
print(GameStatus.Value)
break
end
wait(0.1)
end
end
end)