Jump to content

Player died drop money


RootBey

Recommended Posts

You need an eventHandler, called onPlayerWasted.
When itt calls, first half the money. You can do it by 

local halfMoney = getPlayerMoney(player)/2
setPlayerMoney(player,halfMoney)

Then make an object to the player position by:

local x,y,z = getElementPosition(player)
local moneyPickup = createPickup(x,y,z,3,1212)
setElementData(moneyPickup, 'halfMoney', halfMoney)

And then, you can call another event where you handle the pickup:

addEventHandler('onPickupHit',moneyPickup,function(player)
local halfMoney = getElementData(source, 'halfMoney')
    givePlayerMoney(player,halfMoney)
    destroyElement(source)
end)

And if someone pickups it, destroy the pickup.

 

Another method is create simple object, and on player hit the object destroy it.

Edited by sanyisasha
  • Thanks 1
Link to comment
4 hours ago, sanyisasha said:

PlayerWasted adlı bir eventHandler'a ihtiyacınız var.
Ne zaman arar, ilk yarısı para. Bunu yapabilirsin 


 

Sonra oyuncu pozisyonuna bir nesne yapın:


 
 
 

Ardından, teslim almayı gerçekleştirdiğiniz başka bir etkinliği arayabilirsiniz:



  
    
    

Ve eğer birileri onu alırsa, toplayıcıyı yok edin.

 

Başka bir yöntem basit bir nesne oluşturmaktır ve oyuncu üzerine vurmak nesneyi yok eder.

Thank you beat man ♥️

Can you put it in a script and give it to me?

ı dont use lua  pls can you help me . ???

Link to comment
16 minutes ago, sanyisasha said:

Lol you translate it? :D I see this: Eğer luada yazmazsan, neden bu senaryoya ihtiyacın var?

If you want to make an own server, learn first scripting, or pay someone to make it for you. :D 

Yes bro ım a trasnlate ? , bro ı dont understand lua , after summer go to lua cours . 

Pls bro can you help me ? 

 

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...