|
| 08 Sep 2012 09:18 PM |
So this is what I said to my friend (Who also happens to be a scripter):
Me:
Question: If I do something such as.... (Pardon my vague scripting for a second)
function Player1Leave() end script.Parent.Leave:connect (Player1Leave) --[Ignore that part]
function Forfeit() gui.Text = ..Player1.Name.." Has forfeit!" wait(2) gui.Text = "Picking new rapper..." wait(1) gui.Text = "Picking new rapper.." wait(1) gui.Text = "Picking new rapper.." (What would go here for pick a new rapper?) end
(What would be here for the... Connection?)
if Player1Leave() then Forfeit() end
would that work?
If not, What would I do to make it work???
He said:
Yea.
game.Players.PlayerRemoving:connect(function(player) if player == Player1 then --- elseif player == Player2 then -- end
And the connection has to be an event. --------------------------------------------------------
So basically, I want it to change the text of the gui (script.Parent) and pick a new player when Player1 Or Player2 Leaves.
Help?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Sep 2012 09:24 PM |
--You'd do Game.Players.PlayerRemoving:connect(function(Player) if Player.Name == Player1.Name then Forfiet() end end) |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2012 09:29 PM |
And how would I make "Forfeit()"?
I highly doubt this but... Forfeit() = [Code here] |
|
|
| Report Abuse |
|
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 08 Sep 2012 09:42 PM |
Well..... It'd be something like the random system you use to pick out the original rappers |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 08 Sep 2012 09:46 PM |
exactly how you did,
function Forfeit()
--code here
end |
|
|
| Report Abuse |
|
|
| |
|
mamaguy
|
  |
| Joined: 07 Oct 2010 |
| Total Posts: 7073 |
|
|
| 08 Sep 2012 09:50 PM |
In the original selector, I imagine you did something like players = game.Players:GetPlayers() player1 = players[math.random(#players)] table.remove(players, player1) player2 = players[math.random(#players)] table.remove(players, player2)
So in the forfeit, exactly that. |
|
|
| Report Abuse |
|
|
| |
|