For some reason it fires all 3 events at once, any fix? Heres the mini game script the fires the remote event :
wait(5) local ServerScriptService = game:GetService("ServerScriptService") local Minigame1 = ServerScriptService.MinigameScript:WaitForChild("Minigame1") local Minigame2 = ServerScriptService.MinigameScript:WaitForChild("Minigame2") local Minigame3 = ServerScriptService.MinigameScript:WaitForChild("Minigame3") local map = math.random(1, 3) --Checking if there are atleast 2 players in the game wait(0.1) --Choosing MiniGame if map == 1 then print("Minigame 1 has been chosen") Minigame1:FireServer() else if map == 2 then print("Minigame 2 has been chosen") Minigame2:FireServer() else if map == 3 then print("Mini game 3 has been chosen") Minigame3:FireServer() end end end
There are scripts inside the event, which just print "Minigame 1 fired", ect
Video of studio, scripts and output:
https://imgur.com/a/zMz4Vpc
The reason it printed out multiple times was that there were all in different scripts. What you could've done, was printed them out in the same scripts.
Solution
Make sure it's all in one script!
Recommendation(s)
Fixed Script
local ServerScriptService = game:GetService("ServerScriptService") local tabs = { Minigame1 = ServerScriptService.MinigameScript:WaitForChild("Minigame1"), Minigame2 = ServerScriptService.MinigameScript:WaitForChild("Minigame2"), Minigame3 = ServerScriptService.MinigameScript:WaitForChild("Minigame3"), } wait(5) local map = math.random(1,#tabs) --Checking if there are at least 2 players in the game wait(0.1) --Choosing MiniGame if map == tabs[1] then print("Minigame 1 has been chosen") tabs[1]:FireServer() else if map == tabs[2] then print("Minigame 2 has been chosen") tabs[2]:FireServer() else if map == tabs[3] then print("Mini game 3 has been chosen") tabs[3]:FireServer() end end end