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

Making a minigame type game, better way to setup the script?

What's the better way to set up the types of minigames? I have a table in my Main script chosing the game mode.

gameModes = {"Falling Bricks","Color Plates"}

Now I could either script all the gamemodes into the main script

chosenGamemode = math.random(1,#gameModes)
if gameModes[chosenGamemode] == "Falling Bricks" then
--GameRunsHere
elseif gameModes[chosenGamemode] == "Color Plates" then
--Game runs here
end

Like that, or make a separate script for each gamemode and run them like this,

chosenGamemode = math.random(1,#gameModes)
gamemodeClone = game.ReplicatedStorage.games[gameModes[chosenGamemode]]:Clone()
gamemodeClone = game.ServerScriptStorage

And do it that way?

1 answer

✓ Accepted answer

The second works better for people with bad computers I think. running it from 1 huge script can be pretty hard and may also be hard to find errors while making it if it's going to be a big script.

2 comments

0

Thank you!

0

No problemo :)

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