Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make one winner script, and multiple winner script in minigame and display it on a message?

Asked by 7 years ago

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
0
You need to keep track of who won. Why would "HowManyIngame" tell you who won? cabbler 1942 — 7y
0
I don't know man, I'm oblivious as to how to make a winner game. bigbenbennett 18 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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!

0
How would it to show "Name1, Name2, Name3 won!"? bigbenbennett 18 — 7y
0
Thanks bro really helped. bigbenbennett 18 — 7y
0
I really don't know... marioblast1244 113 — 7y
0
However, thanks for accepting this! marioblast1244 113 — 7y
Ad

Answer this question