Jump to content

Player died drop money


RootBey

Recommended Posts

Posted (edited)

When the player dies, half the money falls. Other people collect money from the ground

help me pls

Edited by RootBey
Posted (edited)

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

Posted
19 minutes ago, RootBey said:

Thank you beat man ♥️

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

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

If you don't script in lua, why need this script? :/

 

  • Confused 1
Posted
1 minute ago, RootBey said:

To use it on my own server ?

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 

  • Sad 1
Posted
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 ? 

 

Posted
3 minutes ago, Gordon_G said:

Bu kodu kopyalamak ve bir .lua dosyasına koymak için bir pro-lua betik olmanıza gerek yoktur.

Sadece wiki'deki betik girişini okuyun ve ne yapacağınızı bilirsiniz.

Thank you bro , good night

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