---- This script is 100% made by Wesley1041. --
-- Don't edit this script unless you know what you're doing! Do only edit the settings/modes. --

-- Settings --
AutomaticTimer = false -- This will have for every minigames the same time limit if enabled. You can edit the time in the settings. Else you have to put the Time value in every minigame.
CashValue = "Points" -- Change this to your points/cash value.
WinnerCash = 20 -- Points which will be given to the winner of a race-themed minigame.
LevelToken = 17
SurvivorCash = 12
ExpValue = "EXP"
FinishCash = 5 -- Points which will be given to people who reach the end of a obstacle course, but aren't 1st.
Time = 40 -- How long a minigame takes if 'AutomaticTimer' is enabled.
Intermission = 10 -- How long players can be in the lobby after a minigame.
MinigameStarts = 5 -- How long did the minigame starts.

--------------------------------------------------------------------------
--------------------------------------------------------------------------
-- Main script --

hint = game.Workspace.GameMinigame.StatsValue
lobbytrack = script.Sounds.Lobby:GetChildren()
choosing = math.random(1, #lobbytrack)
playing = lobbytrack[choosing]

while true do	
	script.Sounds.Music.Area:Stop()
	script.Sounds.Music.Lose:Stop()
	script.Sounds.Music.Winner:Stop()
	playing:Resume()
	WinnerName = nil
	value = Intermission
	while value > 0 do
		hint.Value = "The minigame will start in "..value..""
		value = value-1
		script.Sounds.SoundEffects.Timer:Play()
		wait(1)
	end
hint.Value = "Choosing minigame..."
wait(5)
giverdescr = game.Players.LocalPlayer
windowsalmost = game.Workspace.Lobby.Windows
m = game.Lighting.Minigames:GetChildren()
n = math.random(1,#m)
minigame = m[n]
hint.Value = "Minigame: "..minigame.Name.." by "..minigame.CreatorName.Value..""
playerminigamename = game.Players.LocalPlayer
minigamenamergui = game.ReplicatedStorage.GUI.MinigameNameGui:Clone()
minigamenamergui.Parent = playerminigamename.PlayerGui
minigamenamergui.remve.Disabled = false
script.MinigameName.Value = minigame.Name
script.Creator.Value = minigame.CreatorName.Value
script.Sounds.Music.Area.SoundId = minigame.SoundID.Value
game.ReplicatedStorage.GUI.InstructionsGui.Frame.MinigameName.Text = minigame.Name
game.ReplicatedStorage.GUI.InstructionsGui.Frame.Instruction.Text = minigame.Description.Value
windowsalmost.Transparency = 0.5
map = minigame:clone()
map.Parent = Workspace
wait(3)
cloner2 = game.ReplicatedStorage.GUI.RobloxMinigameTransitionGUI:Clone()
cloner2.Parent = giverdescr.PlayerGui
hint.Value = "Showing InstructionsGui"
giverdescr = game.Players.LocalPlayer
game.ReplicatedStorage.GUI.InstructionsGui.remve.Disabled = false
cloner = game.ReplicatedStorage.GUI.InstructionsGui:Clone()
cloner.Parent = giverdescr.PlayerGui
wait(6)
plrs = game.Players:GetChildren()
	for i = 1, #plrs do
		if plrs[i].PlayerGui.PlayGui.Button.Playing.Value == true then
			plrs[i].Character:MoveTo(map.Spawn.Position)
			plrs[i].TeamColor = BrickColor.new("New Yeller")
		end
	end
	if map.GameType.Value == "Race" or map.GameType.Value == "Obby" then
		value = MinigameStarts
		while value > 0 do
			hint.Value = "The round will begin in "..value..""
			script.Sounds.Music.Area.Volume = 0.5
			script.Sounds.Music.Area:Resume()
			playing:Stop()
			script.Sounds.Music.Countdown:Resume()
			value = value-1
			wait(1)
		end
		for i = 0.05, 1, 0.03 do
			script.Sounds.SoundEffects.Ding:Play()
			map.Wall.Material = "Neon"
			map.Wall.Transparency = i
			hint.Value = "GO!"
			wait()
		end
		map.Wall.CanCollide = false
		WinnerFinished = false
		map.Finish.Touched:connect(function(hit)
			if hit.Parent:findFirstChild("Humanoid") ~= nil then
				local plr = game.Players:findFirstChild(hit.Parent.Name)
				local cash = plr.leaderstats:findFirstChild(CashValue)
				local EXP = plr.leaderstats:findFirstChild(ExpValue) 
				if not WinnerFinished then
					cash.Value = cash.Value+WinnerCash
					EXP.Value = EXP.Value+LevelToken
					WinnerName = plr.Name
					WinnerFinished = true
				else cash.Value = cash.Value+FinishCash
				end
				hit.Parent:MoveTo(Workspace.Lobby.GameSpawn.Position)
				local t = hit.Parent:findFirstChild('Survived')
				if t ~= nil then
					t:remove()
				end
				local h = hit.Parent:findFirstChild('SurvivalCheck')
				if h ~= nil then
					h:remove()
				end
			end
		end)
	end
	plrs = game.Players:GetChildren()
	for i = 1, #plrs do
		if plrs[i].PlayerGui.PlayGui.Button.Playing.Value == true then
			v = Instance.new('BoolValue')
			v.Parent = plrs[i].Character
			v.Name = "Survived"
			v.Value = true
			s = script.SurvivalCheck:clone()
			s.Parent = plrs[i].Character
			s.Disabled = false
		end
	end
	if map.GameType.Value == "Survival" or map.GameType.Value == "Custom" or map.GameType.Value == "Speed Mode" then
		value = MinigameStarts
		while value > 0 do
			hint.Value = "The round will begin in "..value..""
			script.Sounds.Music.Area:Resume()
			script.Sounds.Music.Area.Volume = 0.5
			playing:Stop()
			script.Sounds.Music.Countdown:Resume()
			value = value-1
			wait(1)
		end
		plrs = game.Players:GetChildren()
		for i = 1, #plrs do
			map.DisasterScript.Disabled = false
			script.Sounds.SoundEffects.Ding:Play()
			hint.Value = "GO!"
			wait(1.7)
		end
	end	
	if not AutomaticTimer then
		Time = minigame.Time.Value
	end	
	value = Time
	while value > 0 do
		script.Sounds.Music.Countdown:Stop()
		script.Sounds.Music.Area.Volume = 1
		script.Sounds.SoundEffects.Timer:Play()
		script.Sounds.SoundEffects.Ding:Stop()
		hint.Value = "Time left: "..value..""
		value = value-1
		wait(1)
	end
	if map.GameType.Value == "Survival" or map.GameType.Value == "Custom" or map.GameType.Value == "Speed Mode" then
		hint.Value = "Giving Points & EXP to everyone who wins this round!"
		script.MinigameName.Value = ""
		playerssurvived = game.Players.LocalPlayer
		playerssurvived.TeamColor = BrickColor.new("Institutional white")
		windowsSurvival = game.Workspace.Lobby.Windows
		windowsSurvival.Transparency = 0
		script.Sounds.SoundEffects.Ding:Play()
	end
	if map.GameType.Value == "Race" or map.GameType.Value == "Obby" then
		if WinnerName ~= nil then
			script.MinigameName.Value = ""
			script.Sounds.SoundEffects.Ding:Play()
			script.Sounds.SoundEffects.Timer:Stop()
			players = game.Players.LocalPlayer
			script.Sounds.Music.Area:Stop()
			script.Sounds.Music.Winner:Play()
			players.TeamColor = BrickColor.new("Institutional white")
			hint.Value = "Round over! The winner is "..WinnerName.."!"
			windowsfinished = game.Workspace.Lobby.Windows
			windowsfinished.Transparency = 0
		else
			script.MinigameName.Value = ""
			script.Sounds.SoundEffects.Ding:Play()
			script.Sounds.SoundEffects.Timer:Stop()
			script.Sounds.Music.Area:Stop()
			players.TeamColor = BrickColor.new("Institutional white")
			hint.Value = "Round over! There was no winner this round!"
			windowslose = game.Workspace.Lobby.Windows
			windowslose.Transparency = 0
			script.Sounds.Music.Lose:Play()
		end
	elseif map.GameType.Value == "Survival" or map.GameType.Value == "Custom" then
		plrs = game.Players:GetChildren()
		for i = 1, #plrs do
			local s = plrs[i].Character:findFirstChild('SurvivalCheck')
			if s ~= nil then
				s:remove()
			end
			local t = plrs[i].Character:findFirstChild('Survived')
			if t ~= nil then
				if t.Value == true then
					plrs[i].leaderstats.Points.Value = plrs[i].leaderstats.Points.Value+SurvivorCash
					plrs[i].leaderstats.EXP.Value = plrs[i].leaderstats.EXP.Value+LevelToken
				end
			end
		end
	end
	if map.GameType == "Custom" then
		plrs[i].Character:BreakJoints()
	end
	map:remove()
	wait(1)
	for i = 1, #plrs do
		local t = plrs[i].Character:findFirstChild('Survived')
		if t ~= nil then
			if t.Value == true then
				plrs[i].Character:MoveTo(Workspace.Lobby.GameSpawn.Position or Workspace.Lobby.GameSpawn2.Position)
			end
		end
	end
	wait(4)
end

1 comment

0

Explain your question instead of just pasting a script you found on the internet and expecting us to make your game for you, please.