generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I am in sort of a pickle....

Previous Thread :: Next Thread 
churchdrummer2 is not online. churchdrummer2
Joined: 01 Aug 2011
Total Posts: 265
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
churchdrummer2 is not online. churchdrummer2
Joined: 01 Aug 2011
Total Posts: 265
08 Sep 2012 09:23 PM
Bump.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
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
churchdrummer2 is not online. churchdrummer2
Joined: 01 Aug 2011
Total Posts: 265
08 Sep 2012 09:29 PM
And how would I make "Forfeit()"?


I highly doubt this but... Forfeit() = [Code here]
Report Abuse
mamaguy is not online. 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 is not online. 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
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
08 Sep 2012 09:47 PM
Use a value
Report Abuse
mamaguy is not online. 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
churchdrummer2 is not online. churchdrummer2
Joined: 01 Aug 2011
Total Posts: 265
08 Sep 2012 10:07 PM
Something like that.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image