Hi,
I'm making a showdown game where two random people are picked at random inside the dome but two different sides inside the dome while everyone spectates from the outside.
I want my round system to go like:
INTERMISSION - 30 seconds
ROUND TIME -120 seconds
VOTING TIME - 45 Seconds
So the whole idea is that just before ROUND TIME that two DIFFERENT random players are picked and teleported to the two different locations and show down. They are then teleported back to the lobby at the end of the round and everyone votes for the best one.
The Voting System will work so that a gui will show up at the start of voting time with each of the users names and faces and they press on the best one.
The winner from the vote can either be printed in the chat or as another screen gui but whatever is easier.
Below i have attached what I have tried to do so far but if anyone has any suggestions that doesn't include anything I have done (because its probably all wrong anyway :-)).
Thank you so much for your help
local funMod = require(game.ServerScriptService.FunctionModScript) local gameOver = true local gameTime = 120 local lobbySpawn = game.Workspace.SpawnLocation local SpawnPad1 = game.Workspace.Pad1Spawn local SpawnPad2 = game.Workspace.Pad2Spawn
Located inside server script service as one script game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character)
local isPlaying = Instance.new ("BoolValue", character)
isPlaying.Name = "PlayingGame"
isPlaying.Value = false
while wait(1)do
if gameOver then
gameOver = funMod.WaitForGame(gameOver)
else
if gameTime ~= 0 then
if character.PlayingGame.Value == false then
character.PlayingGame.Value = true
local function selectPlayer1()
players = game.Players:GetPlayers()
pad1selected = players[math.random(1,#players)]
return pad1selected
end
randomPlayer1 = selectPlayer1()
if randomPlayer1 and randomPlayer1.Character then
randomPlayer1.Character.HumanoidRootPart.CFrame = SpawnPad1 + CFrame
end
local function selectPlayer2()
repeat
players = game.Players:GetPlayers()
pad2selected = players[math.random(1, #players)]
until
pad2selected ~= pad1selected
return pad2selected
end
randomPlayer2 = selectPlayer2()
if randomPlayer2 and randomPlayer2.Character then
randomPlayer.Character.HumanoidRootPart.Cframe = SpawnPad2 + CFrame
end
end
print("Game Time Remaining "..tostring(gameTime).." Seconds.")
gameTime = gameTime -1
else
if character.PlayingGame.Value == true then
character.PlayingGame.Value = false
character.HumanoidRootPart.CFrame = lobbySpawn.CFrame + Vector3.new(0,5,0)
end
gameOver= true
gameTime = 240
end
end
end
end)
end)
Also located within Server script service and labelled as a script for the Timer Gui
local funMod = require(game.ServerScriptService.FunctionModScript)
local gameOver = true
local gameTime = 120
local lobbySpawn = game.Workspace.SpawnLocation
local SpawnPad1 = game.Workspace.Pad1Spawn
local SpawnPad2 = game.Workspace.Pad2Spawn
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local isPlaying = Instance.new ("BoolValue", character)
isPlaying.Name = "PlayingGame"
isPlaying.Value = false
while wait(1)do
if gameOver then
gameOver = funMod.WaitForGame(gameOver)
else
if gameTime ~= 0 then
if character.PlayingGame.Value == false then
character.PlayingGame.Value = true
local function selectPlayer1()
players = game.Players:GetPlayers()
pad1selected = players[math.random(1,#players)]
return pad1selected
end
randomPlayer1 = selectPlayer1()
if randomPlayer1 and randomPlayer1.Character then
randomPlayer1.Character.HumanoidRootPart.CFrame = SpawnPad1 + CFrame
end
local function selectPlayer2()
repeat
players = game.Players:GetPlayers()
pad2selected = players[math.random(1, #players)]
until
pad2selected ~= pad1selected
return pad2selected
end
randomPlayer2 = selectPlayer2()
if randomPlayer2 and randomPlayer2.Character then
randomPlayer.Character.HumanoidRootPart.Cframe = SpawnPad2 + CFrame
end
end
print("Game Time Remaining "..tostring(gameTime).." Seconds.")
gameTime = gameTime -1
else
if character.PlayingGame.Value == true then
character.PlayingGame.Value = false
character.HumanoidRootPart.CFrame = lobbySpawn.CFrame + Vector3.new(0,5,0)
end
gameOver= true
gameTime = 240
end
end
end
end)
end)
Also located in server script service labelled as a function mod script
local IntermissionTime = 30
local VotingTime = 45
local funMod = {}
function funMod.WaitForGame (gameOver)
if VotingTime == 0 then
VotingTime = 45 and IntermissionTime == 30
return false
else
VotingTime = VotingTime -1
print("Voting Time - You have "..tostring(VotingTime).." Seconds left")
if VotingTime == 0 then
IntermissionTime = IntermissionTime -1
return true
end
end
end
return funMod
Inside a gui called timer i have this local script
local Status = game.ReplicatedStorage.Status
local TextLabel = script.parent. TextLabel
Status.Changed:Connect(function()
TextLabel.Text = Status.Value
end)
In replicated storage i have also got a
a boolean value called 'InRound'
a string value called 'Status'
THANK YOU SO MUCH**
