Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i repeat?

Do i need to put the hole thing in () or is there like a different way? I dont understand it or do it just leave repeat?

1 answer

Lets say you want to repeat something until it's not the same thing.

So you have 2 maps. You Don't want the repetition of the same map. So there is a variable that holds the name of the last map. In this case it's Map2. So we need to get Map1. Here is how you make sure it get's map1.

LastMap = "Map2"

while true do
local Maps = {Map1,Map2}
local NextMap = ""
repeat
NextMap = Maps[math.random(1, #Maps)]
until NextMap ~= LastMap

So you have a map picker that repeats the process until you have a map that wasn't played last round. There are plenty more things repeat can be used for.

This discussion is preserved as it was. New answers, comments, and votes are closed.