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

So how would i mention wait for child Minigame.Minigame 1?

Asked by
OFF_S4LE 127
3 years ago
Edited 3 years ago

so im tryna do a wait for child thing would i type the whole "MiniGame.Minigame1" or just Minigame 1

heres an attempt i guess

local ServerScriptService = game:GetService("ReplicatedStorage")

local remoteEvent = ServerScriptService:WaitForChild("Minigame Script.Minigame 1")
local map = math.random(1, 3)

--Checking if there are atleast 2 players in the game

players = game.Players:GetChildren()
if #players >= 2 then

    --Choosing MiniGame

    if map == 1 then
        print("Minigame 1 has been chosen")

    else
        if map == 2 then
            print("Minigame 2 has been chosen")
        else
            if map == 3 then
                print("Mini game 3 has been chosen")
            end
        end
    end
end

1 answer

Log in to vote
1
Answered by
WoTrox 345 Moderation Voter
3 years ago
ServerScriptService.MinigameScript:WaitForChild("Minigame1")

or

ServerScriptService:WaitForChild("MinigameScript"):WaitForChild("Minigame1")
Ad

Answer this question