I need to know what the best function for a game script is. By function I mean While true do and stuff. I know while true do isn't the best but it was just an example. Please answer with the best function.
To make it look like help here.
while true do print("Guy 2:Oh no, The game broke") wait(0.5) print("Guy 1:What are we going to do?") wait(1) print("Guy 2:Go on scripting helpers and find a new method.") wait(9000) print("Guy 1:Ok") :D end
while true do end
will run continuously, with no end, so "Guy 2" will eventually just repeat himself a thousand times.
Game scripts can be very complex, if you can't understand moderate scripting I would suggest simply doing something very basic, which does indeed mean using a while loop. Perhaps you can do something like this:
local RoundTime = 180 local function NewRound(Players) -- Teleport all players into a map of some kind, and give weapons end while wait(RoundTime) do -- Teleport all players to a lobby Wait(30) -- Intermission time NewRound(Game.Players:GetPlayers()) end