var
Players = list() // Players in queue
Game // Game going on or not
Problem description:
Well, the game I'm trying to make has a global Player list (those in the game) and the game var is to check whether they're playing or not. My problem is that this is not working. Either this is not the way to go about a world list or
Start() // Start the game
if(length(Players) >= 1) // At least 2 to start a game
world << "A new battle has begun!"
while(Players) // While the Players list still has values
var/mob/A = pick(Players) // Pick a mob at random
for(var/mob/M in world)
if(M.name == A)
Players -= A // Remove them from the list (So that they're not moved again and so that the game knows when to stop)
M.loc = locate(13,13,2)
M.loc = pick(/area/Spawn) // Spawn them at a Spawn point
M.icon = 'Boats.dmi'
else // If there are not enough people to start a game
src << "There must be at least 2 People to start!"
Join() // Join the game
Players += "[src.name]" // Add player to Player list
// Add a removal of Join verb to prevent abuse
Leave() // Leave the game
Players -= "[src.name]" // Remove player from Player list
If there's not an infinite loop currently, it's probably because it's crashing on a pick() from an empty list.