[KoG]Rouche Posted July 25, 2010 Share Posted July 25, 2010 Have anyone an idea about "how to script for a lottery game on mta race serveur" ? U buy a ticket and at the end of the map a random number appear and the winner win money. 4 Years ago i saw this script on a server. Link to comment
Dark Dragon Posted July 26, 2010 Share Posted July 26, 2010 basically all you need is inserting players into a table and in the end of a map select a random one. local playertable = {} function playLottery(player) takePlayerMoney(player,100) table.insert(playertable,player) end addCommandHandler("lottery",playLottery) function chooseWinner() local winner = playertable[math.random(1,#playertable)] givePlayerMoney(winner,1000) playertable = {} end of course you have to call that second function at some point Link to comment
[KoG]Rouche Posted July 26, 2010 Author Share Posted July 26, 2010 Ok thanks i'll try it Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now