|
| 02 Jul 2014 07:58 AM |
Im making a minigame place. I wanna make a script that shows a list of winners. I need a script of a message saying people's name of the workspace saying that they won the game. For example, if there is the players a,b and c it would appear a message saying "a,b and c won the game" How do i do that?
I know how do the rest (sorry for my english) |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Jul 2014 08:14 AM |
WinningTable = {} WinningMessage = Instance.new("Message") while wait() do for i,v in pairs(WinningTable) do table.insert(WinningTable, Player.Name) if #Winning == AmountOfPlayersHere then WinningMessage.Text = v.."Has won!" break end end end You'll have to adjust this to work with your script. |
|
|
| Report Abuse |
|
|
YeahNick
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 2536 |
|
|
| 02 Jul 2014 08:15 AM |
local m = Instance.new("Message",Workspace) m.Text = a.Name .. ", " .. b.Name .. " and " .. c.Name .. " won the game."
#Yolo |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 12:46 PM |
| Amount of players do you mean their name or just the number of players? |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 04 Jul 2014 12:48 PM |
| Text = Winners.concat(', ').." has won!" |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 12:57 PM |
So if i want to make a script that makes a message with all name players in the game, what do i edit?
WinningTable = {} WinningMessage = Instance.new("Message") while wait() do for i,v in pairs(WinningTable) do table.insert(WinningTable, Player.Name) if #Winning == AmountOfPlayersHere then WinningMessage.Text = v.."Has won!" break end end end |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:00 PM |
| Change "AmountOfPlayersHere" to the amount of winners you want. |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:00 PM |
| Also, change #Winning to #WinningTable |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:01 PM |
| game.Players:GetChildren()? |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:04 PM |
WinningTable = {} WinningMessage = Instance.new("Message") WinValue = Instance.new("StringValue") WinValue.Value = "Win" while wait() do for _,v in pairs(game.Players:GetChildren()) do if v:FindFirstChild("WinValue") then table.insert(WinningTable, v.Name) if #Winning == AmountOfPlayersHereThatWon then WinningMessage.Text = v.."Has won!" break end end end end |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:18 PM |
| 20:16:09.520 - Workspace.Script:7: attempt to concatenate local 'v' (a userdata value) |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:19 PM |
| something is wrong with WinningMessage.Text = v.."has won" |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2014 01:23 PM |
| WinningMessage.Text = v.Name.."Has won!" |
|
|
| Report Abuse |
|
|
| |
|