Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

dude can someone help me please? "minigame system" problem?

So my game start fine, with intermission time, and it fails when its time to tp players to a random map and then give players guns, that i have on server storage, the script just ignores the WHOLE BLOCK of Map,Teleporting and giving players code, so what's the problem with my script? it jumps from intermission to Round without even loading the map, so i guess something bad i am doing. Please, help me. if u have doubt about killing the players, is because i want them to respawn in their respective team spawn.

FUNCTIONS

Status.Changed:Connect(function()
	game.ReplicatedStorage.TimerEvent:FireAllClients()
end)

local function ChoosenMap()
	
	local randomizer = Maps[math.random(1,#Maps)]:Clone()
	randomizer.Parent = game.Workspace
	
end

local  givePlayers = coroutine.wrap(function()
	local players = game.Players:GetChildren()
	local tommyGun = serverStorage:FindFirstChild("Tommy Gun")
	if tommyGun then
		local tool = tommyGun:Clone()
	tool.Parent = players.Backpack
	end
end)

"WHILE TRUE DO" CODE

while true do
	repeat 
		
		Status.Value = "Need 2 players to start! "
		wait(1)
		
	until #game.Players:GetPlayers() >= 0
	
	
	
	for i = intermission,0,-1 do 
		Status.Value = "intermission: " .. i 
		wait(1)	
		print("loop 1 sucess")	
	end	
	
	inRound.Value = true
	wait(3)
	
	local players = game.Players:GetPlayers()
	if inRound == true then
		for i, v in pairs(game.Workspace.Lobby.LobbySpawns:GetChildren())do
			v.Enabled = false
		end
		
		ChoosenMap()
		wait(7)
		
		for i, plr in pairs(game.Players:GetChildren())do
			if plr.Character:FindFirstChild("Humanoid") then
				plr.Character.Humanoid.Health:TakeDamage(100)
			end
		end
		givePlayers()
	end
	
	
	print("getting on round code block.")
		
	
	for i = 120, 0, -1 do 
		Status.Value = "Round: " .. i
		wait(1)
	end
	
	if inRound == false then
		local lobbysP = game.Workspace.Lobby.LobbySpawns:GetChildren()
		lobbysP.Enabled = true
		ChoosenMap():Destroy()
		players.Backpack:ClearAllChildren()
		players.Character:FindFirstChild("Humanoid"):TakeDamage(100)
	end
end	
	

1 comment

1

I guess you forgot to put "inRound.Value" on line 21

1 answer

✓ Accepted answer

Your script isn't firing due to errors on lines 21 and 46. You're looking for the values of inRound, so you'll want to replace those

if inRound == true then
if inRound == false then

with

if inRound.Value == true then
if inRound.Value == false then

I hope this answers your question.

1 comment

0

DUDE THANKS SO MUCH THANKS THANKS THANKS!!!!!!!!!!!!!

This discussion is preserved as it was. New answers, comments, and votes are closed.