Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
dirk2999 103
6 years ago
Edited 6 years ago

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

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

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

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

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

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

And do it that way?

1 answer

Log in to vote
1
Answered by 6 years ago

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.

0
Thank you! dirk2999 103 — 6y
0
No problemo :) DanielDeJong3 158 — 6y
Ad

Answer this question