So i basically was making a piggy game with Alvinblox's kit. Basically i couldn't fix this bug in my game, basically in a round if all the players die then the piggy wins right? So basically i made those types of situations when the piggy wins or the time goes out or when everyone escapes. So the problem I have is with the piggy wins thing, everything else seems to work. Here is the code, Also forgot to mention that each time these situations happen a status value changes it's a string value. And then it is used on a gui
local function toMS(s)
return ("i:i"):format(s/60%60, s%60)
end
function module.StartRound(length,piggy,chapterMap)
local outcome
for i = length,0,-1 do
if i == (length - 20) then
module.TeleportPlayers({piggy}, chapterMap.PlayerSpawns:GetChildren(),5)
status.Value = "Executor has woken up!"
wait(4)
end
local contestants = {}
local isPiggyHere = false
for i, player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("Contestant") then
table.insert(contestants,player)
elseif player:FindFirstChild("Piggy") then
isPiggyHere = true
end
end
if not isPiggyHere then
outcome = "Piggy-Left"
break
end
if #contestants == 0 then
outcome = "Piggy-Won!"
break
end
if i == 0 then
outcome = "Game-Over"
break
end
status.Value = toMS(i)
wait(1)
end
if outcome == "Piggy-Won" then
status.Value = "Piggy has won"
elseif outcome == "Game-Over" then
status.Value = "Game Over!"
elseif outcome == "Piggy-Left" then
status.Value = "Piggy Left"
end
wait(5)
end

1 comment
Hi, a bit sidetrack here, but I see you also using the Alvin's kit, seeing your question. I can see you most possibly able to make the teleportation of the piggy and the players at the start of the game work.