Hello, people, I am wondering how to make a script where a message will be displayed after a certain amount of people win. And if I want to make a script where only one person can win how do I do that? My current script:
for i,v in pairs(game.Players:GetPlayers()) do if game.Workspace.GamePlaying.Value == true then game.Workspace.GamePlaying.Value = false if HowManyIngame.Value > 0 then UniversalText.Value = v.Name .. " Wins" end if HowManyIngame == 0 then UniversalText = "No one won!" end end end
I'm pretty sure that you need another if
statement. Try this:
for i.v in pairs(game.Players:GetPlayers()) do if game.Workspace.GanePlaying.Value == ture then game.Workspace.GamePlaying.Value == false if HowManyIngame.Value < nil then -- replace nil with how many people you want to allow win if HowManyIngame.Value > 0 then UniversalText.Value = v.Name . . " Wins" end if HowManyIngame == 0 then UniversalText.Value = "No one won!" end end end
When doing this, I also found that you forgot to do UniversalText.Value
on line 8. Hope this helped!