Hello, everyone!
I’ve been making a Minigame place and have a script for each minigame and a main script. Each minigame script is disabled and when the main script picks a random minigame, it fails to enable the script. Let me show you some of my code:
local num = math.random(1,5)
for i, v in pairs(game.ReplicatedStorage.Minigames:GetChildren()) do
if v:IsA(“Script”) then
Game:ReplicatedStorage.Minigames:GetChildren()[num].Disabled = false
print(“game.ReplicatedStorage.Minigames:GetChildren()[num].name”)
break
end
end
I’m not getting any error messages and the minigame name is only printing once (from the server script). It should be printing twice because in each minigame script I am printing the name of the minigame. So the problem is that the script isn’t enabling when it should be. Here is the minigame scripts (the scripts that aren’t enabling) for those who need it:
-- Sword Fight
script.Disabled = true
print(“Sword Fight Chosen”) -- This part is different for each script/minigame.
Thanks for any help! If you have any questions, I’ll be happy to answer.