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.

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

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