Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

2 comments

0

You need to keep track of who won. Why would "HowManyIngame" tell you who won?

0

I don't know man, I'm oblivious as to how to make a winner game.

1 answer

✓ Accepted answer

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!

4 comments

0

How would it to show "Name1, Name2, Name3 won!"?

0

Thanks bro really helped.

0

I really don't know...

0

However, thanks for accepting this!

This discussion is preserved as it was. New answers, comments, and votes are closed.