Hooks PlayerPickupMoney - brianhang/nutscript2 GitHub Wiki

Description

allowed = PlayerPickupMoney(client, entity)

This server hook is called when a player tries to pick up a money entity.

Parameters

Name Description
client The Player that attempted to pick up the entity.
entity The Entity that is the money entity.

Returns

Name Description
allowed false to prevent the money entity from being picked up.

Example

-- Prevent the money entity from being picked up if the player
-- already has a lot of money.
function GM:PlayerPickupMoney(client, entity)
    local character = client:getChar()

    if (character and character:getMoney() > 1000000) then
        return false
    end
end