Paplo Posted June 20, 2013 Share Posted June 20, 2013 randomTime = 10 -- hours randomPlayer = getRandomPlayer ( ) rplayer = getPlayerName ( randomPlayer ) setTimer(function() local money = math.random(3000, 15000) for i,randomPlayer in ipairs(getElementsByType("player")) do givePlayerMoney(randomPlayer, money) outputChatBox ("[RANDOM] #FFFFFF"..getPlayerName ( randomPlayer ).." #FFFFFFget "..money.." !",root,255,136,0,true) end end , randomTime*1000, 0) this mode give players money at 10 sc i need to give 1 player random in 10 sc not all player how i can do that? Link to comment
Paplo Posted June 20, 2013 Author Share Posted June 20, 2013 to who you want to give? Luck is not one particular Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 you mean random players in the server? Link to comment
Paplo Posted June 20, 2013 Author Share Posted June 20, 2013 you mean random players in the server? yes I want to give money randomly on players Link to comment
iPrestege Posted June 20, 2013 Share Posted June 20, 2013 addEventHandler('onResourceStart',resourceRoot, function ( ) setTimer ( function ( ) local aPlayer = getRandomPlayer ( ) local aMoney = math.random ( 3000,15000 ) if aPlayer and aMoney then givePlayerMoney ( aPlayer,aMoney ) outputChatBox ('[RANDOM] #FFFFFF'..getPlayerName ( aPlayer )..' #FFFFFFget '..aMoney..' !',root,255,136,0,true) end end,10000,0 ) end ) Not tested. Link to comment
Paplo Posted June 20, 2013 Author Share Posted June 20, 2013 addEventHandler('onResourceStart',resourceRoot, function ( ) setTimer ( function ( ) local aPlayer = getRandomPlayer ( ) local aMoney = math.random ( 3000,15000 ) if aPlayer and aMoney then givePlayerMoney ( aPlayer,aMoney ) outputChatBox ('[RANDOM] #FFFFFF'..getPlayerName ( aPlayer )..' #FFFFFFget '..aMoney..' !',root,255,136,0,true) end end,10000,0 ) end ) Not tested. thank you ^^ Link to comment
iPrestege Posted June 20, 2013 Share Posted June 20, 2013 You're welcome . P.S : I know you're 6ArHxiMr'3a[Z]eF . Link to comment
ixjf Posted June 20, 2013 Share Posted June 20, 2013 addEventHandler('onResourceStart',resourceRoot, function ( ) setTimer ( function ( ) local aPlayer = getRandomPlayer ( ) local aMoney = math.random ( 3000,15000 ) if aPlayer and aMoney then givePlayerMoney ( aPlayer,aMoney ) outputChatBox ('[RANDOM] #FFFFFF'..getPlayerName ( aPlayer )..' #FFFFFFget '..aMoney..' !',root,255,136,0,true) end end,10000,0 ) end ) Not tested. Since when are element and number variables tables? Link to comment
iMr.3a[Z]eF Posted June 20, 2013 Share Posted June 20, 2013 You're welcome .P.S : I know you're 6ArHxiMr'3a[Z]eF . i dont understand you lol 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