A resource containing minigames that can be exported and used by FiveM servers. Each minigame comes with default settings found in client.lua
in the minigamesTable
variable. To set specific settings for different instances of a minigame, add a settings argument into the export. If settings are not specified, the default settings will apply.
local settings = {gridSize = 15, lives = 2, timeLimit = 10000}
exports["glow_minigames"]:StartMinigame(function(success)
if success then
print("win")
else
print("lose")
end
end, "path", settings)
- Drag and drop into your resources file and ensure glow_minigames in your server.cfg
A start and end screen will display before and after the minigame.
To change the icon or message displayed on this screen go to main.js
and edit the variable startEndScreens
- Use arrow keys or WASD to move the green player square from the bottom to top of the board, following the path
- If player strays from the path, a life is lost
- Player loses if they lose too many lives or the timer runs out
exports["glow_minigames"]:StartMinigame(function(success)
if success then
print("win")
else
print("lose")
end
end, "path")
local settings = {gridSize = 19, lives = 3, timeLimit = 10000}
-- Creates a grid (19x19) squares
-- Max gridsize is 31 and should be an odd number
- A target character appears above the board that the player must find and click on
- Characters other than the target character will fade in and out and randomly change to other characters
- Complete the number of required finds to win
- Player loses if they run out of time
exports["glow_minigames"]:StartMinigame(function(success)
if success then
print("win")
else
print("lose")
end
end, "spot")
local settings = {gridSize = 6, timeLimit = 8000, charSet = "alphabet", required = 10}
-- Max gridsize is 10
-- Available charSet: numeric, alphabet, alphanumeric, greek, runes, braille
- Fill out the board with numbers 1-9 so that each column and row satisfies the answer in green
- Each number should only be used once
- Multiplication takes precedence, and is calculated before adding and subtracting
- The player will lose if time runs out or they submit an incorrect board
exports["glow_minigames"]:StartMinigame(function(success)
if success then
print("win")
else
print("lose")
end
end, "math")
local settings = {timeLimit = 300000}
To test minigames, un-comment the following command in client.lua
, and run it with the name of the minigame you'd like to test i.e. /minitest path
RegisterCommand("minitest", function(source, args)
StartMinigame(function(success)
print(success)
end, args[1])
end, false)