so I've been working on a game that has rounds and intermission. What I am trying to do is that when round ends, it fires intermission and then it starts again. Here is the script I want to fire when the intermission is over.
function update(count) local player = game.Players.LocalPlayer game.Players.LocalPlayer.PlayerGui.pods.ann.TextButton.Text = "Waiting for "..count.." more players!" if count <= 0 and game.Workspace.game.CanCollide == true then game.Players.LocalPlayer.PlayerGui.pods.ann.Visible = true game.Players.LocalPlayer.PlayerGui.pods.ann.TextButton.Text = "Welcome to the annual HUNGER GAMES" wait(10) game.Players.LocalPlayer.PlayerGui.pods.ann.TextButton.Text = "If you don't know how to play, read the description!" wait(10) player.TeamColor = BrickColor.new("Forest green") game.Players.LocalPlayer.PlayerGui.pods.ann.TextButton.Text = "Selecting random arena..." wait(5) game.Players.LocalPlayer.PlayerGui.pods.ann.TextButton.Text = "Arena selected. Prepare to enter the game. May the odds be ever in your favor." wait(20) game.Players.LocalPlayer.PlayerGui.pods.ann.Visible = false local Pos = player.Character:GetPrimaryPartCFrame() player:LoadCharacter() player.Character:SetPrimaryPartCFrame(Pos) if player.Character:FindFirstChild("ForceField") then player.Character["ForceField"]:Destroy() wait(1) game.ReplicatedStorage.Remotes.tp:FireServer() game.Workspace.game.CanCollide = false end end end game.ReplicatedStorage.Notify.OnClientEvent:connect(update)
here is the script that I want to fire the script above.
local player = game.Players.LocalPlayer game.Players.LocalPlayer.PlayerGui.pods.ann.Visible = true game.Players.LocalPlayer.PlayerGui.pods.ann.TextButton.Text = "Intermission.." wait(30) game.Players.LocalPlayer.PlayerGui.pods.ann.Visible = false game.Workspace.game.CanCollide = true local Pos = player.Character:GetPrimaryPartCFrame() player:LoadCharacter() player.Character:SetPrimaryPartCFrame(Pos) if player.Character:FindFirstChild("ForceField") then player.Character["ForceField"]:Destroy() game.Workspace.inter.CanCollide = false game.ReplicatedStorage.Remotes.start:FireServer() end
Do any of you have any ideas? I am lost. Any help will be appreciated.
You can easily loop functions by firing the function again.
Example:
function createPart() Instance.new("Part", workspace) wait(1) createPart() end
Basically works like a while wait(), while true, etc
.