Jump to content

Will this work i cant test


Recommended Posts

Hello i made a script when somone kills a other player he will get random money but i made it on tablet adn i cant test it :( can somone test it for me

rmoney = { 
[1]=1210, 
[2]=6325, 
[3]=3629, 
[4]=2958, 
[5]=591, 
 } 
  
money = math.random (1,5)  
  
 function player_Wasted ( ammo, attacker, weapon, bodypart ) 
    if ( attacker and attacker ~= source ) then 
        givePlayerMoney ( attacker, rmoney[money] ) 
    end 
end 
  
addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted ) 
  

Link to comment
local rmoney = {1210, 6235, 3629, 2958, 591} 
  
function kill (killer, weapon, bodypart, loss) 
if (killer) then 
   givePlayerMoney ( killer, rmoney[ math.random(#rmoney) ] ) 
end 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), kill) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...