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