Mini Game detects no player when round start

So, it’s a mini game, you’re in the lobby then intermission then the game start. And it counts down until a player touches the end or gets to the end.

The issue is when it loads and puts player into the game. It for some reason doesn’t detect any player and well says no one won.

So far, I thought it might be the platform, but it wasn’t.

Main Script

local s = script.stat
local vals = game.ReplicatedStorage.vals

t = 0

while true do
	t = 15
	repeat
		t = t - 1
		s.Value = "Intermission.." ..t
		wait(1)
	until t == 0
	s.Value = "Game starting!"
	wait(2)
	
	local mapselect = game.ReplicatedStorage.Games:GetChildren()
	local choose = math.random(1, #mapselect)
	curnum = 0
	for i = 1, #mapselect do
		curnum = curnum + 1
		if curnum == choose then
			mapselect[i]:Clone().Parent = workspace
			curmap = mapselect[i].Name
			s.Value = "We'll be playing.." ..mapselect[i].Name
		end
	end
	wait(3)
	
	local plrs = game.Players:GetChildren()
	for i = 1, #plrs do
		local num = math.random(1,1)
		plrs[i].Character.HumanoidRootPart.CFrame = CFrame.new(workspace.Teleports["Mini-"..num].Position)
		plrs[i].Character.Parent = workspace.inGame
	end
	t = 30
	repeat
		t = t -1
		s.Value = t.." seconds left"
		wait(1)
	until t == 0 or vals.Winner ~= ''
	if vals.Winner.Value ~= '' then
		s.Value = vals.Winner.Value.. ' has won!'
		vals.Winner.Value = ''
	else
		s.Value = 'No one won!'
	end
	wait(3)
	
	local ingame = workspace.inGame:GetChildren()
	for i = 1, #ingame do
		local plr = game.Players:GetPlayerFromCharacter(ingame[i])
		--print(vals.Winner)
		plr:LoadCharacter()
		workspace[curmap]:Destroy()
	end
end

image

image

I’m revising this specific section and experimenting but still haven’t got a clue

if vals.Winner.Value ~= '' then
		s.Value = vals.Winner.Value.. ' has won!'
		vals.Winner.Value = ''
	else
		s.Value = 'No one won!'
	end
	wait(3)
	
	local ingame = workspace.inGame:GetChildren()
	for i = 1, #ingame do
		local plr = game.Players:GetPlayerFromCharacter(ingame[i])
		--print(vals.Winner)
		plr:LoadCharacter()
		workspace[curmap]:Destroy()
	end

apparently if I remove the until “or vals.Winner ~= “”” It doesn’t automatically end the round.

	t = 30
	repeat
		t = t - 1
		s.Value = t.." seconds left"
		wait(1)
	until t == 0 --or vals.Winner ~= ""
	if vals.Winner.Value ~= '' then
		s.Value = vals.Winner.Value.. ' has won!'
		vals.Winner.Value = ''
	else
		s.Value = 'No one won!'
	end
	wait(3)

Don’t forget the .Value, this should actually be until t == 0 or vals.Winner.Value ~= ''

2 Likes

Ah, Thank you. Tried it and it got fixed. :grinning: