How to compare 1 name to every child of something and have the matching one be referenced later in the script

I’m using multiple events because each minigame will have scripts required to make it work. Each script triggers based off of the RemoteEvent that was fired. If I just used one then I wouldn’t be able to separate the other scripts.

Can’t you do this

Local ballMiniGameModule = require(game.ServerScriptService:FindFirstChild(“BallMiniGameScript”))

Local Event = game.ReplicatedStorage.RemoteEvent

Event.OnClientEvent:Connect(Function(MiniGameResult)

If MiniGameResult == “Ball Game” then
ballMiniGameModule.MiniGameLogic()
Else if MiniGameResult == “FloorIsLava” then
—do the same thing as above but for this mini game
end
end)

You probably need to check the script before using it since I wrote this on phone

1 Like

I don’t know how I would set that up.

This script is assuming you sent the result variable to the server using a remote event. What the script is doing is checking what the result is, so is the random mini game “ball game” or is it “floor is lava”. Let’s say it is ball game then it will call a function from a module script which handles the logic for the ball game, same goes for the other mini games but different functions or a another module. So to set this up it would need to be on a server script and linked to the remote server event sending the result

I have no idea how to do that sadly. This is new territory for me.

time to explore mate! Your not a game creator . you are a developer. you develop your skill along the way! that a side . I will create a simple plan for your voting system

  1. the server will pick 3 maps out and send the name of the 3 maps using a remote event
    remote:FireAllClient(map1,map2,map3)

2)the client will receive the message of the 3 maps and ask the player to vote . when the player vote, send the server a message using the same remote event
remote:FireServer(optionNumber)

  1. the server will then receive the option number and add a vote to the map using a variables called
local Map1VoteCount = 0
local Map2VoteCount = 0
local Map3VoteCount = 0

once the map is chosen, you can load the map in and the scripts. the script that handle the minigame should be disabled. when you load the script in, enable it and parent it to the map