Jump to content

DropMoney


Narutimmy

Recommended Posts

Hola quiero hacer un script que al precionar la Tecla "b" se cree un pickup de dinero en el piso y otro usuario lo pueda tomar y que suene un sonido que solo escuche el que lo precione...

Asi esta bien?

function DropMoney (thePlayer) 
   
    x,y,z  = getElementPosition ( source )  
    money = createPickup ( x + 3,y,z, 3, 1212,0 )   - 
     
if money then  
if (getPlayerMoney() <= 50) then 
  
x,y,z  = getElementPosition ( source )  
money = createPickup ( x + 3,y,z, 3, 1212,0 ) 
takePlayerMoney(thePlayer, 50) 
playSound ( "Money.mp3" ) 
  
  
function GivePlayerMoney (thePlayer) 
givePlayerMoney ( thePlayer, 50 )   
destroyElement ( source )   
end 
addEventHandler ( "onPickupHit", money, GivePlayerMoney ) 
  end 
  end 
end 
  
  
  
  
bindKey ( thePlayer,"b","down",DropMoney ) 

Link to comment
  • Recently Browsing   0 members

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