Jump to content

error money


Recommended Posts

On 07/07/2022 at 19:04, Sylver Scott said:

triggered serverside event giveMoney, but event is not added serverside

does anyone how can i fix this Error ? it doesnt give u money afeter u finish the job...

Insert into server file

addEvent ("giveMoney", true)
addEventHandler ("giveMoney", root, function(...)
    local args = {...}
    local pl
    local money
    if source == resourceRoot then
      pl = client
      money = tonumber(args[1]) and args[1] or args[2]
    elseif getElementType(source) == "player" then
      pl = source
      money = tonumber(args[1]) and args[1] or args[2]
    elseif args[1] and getElementType(args[1]) == "player" then
      pl = args[1]
      money = args[2]
    end
    
    if not pl or not money then
      error ("Player or money not found!")
    end
    
    givePlayerMoney (pl, money)
end)

Universal code) 
P.S. I not testing

  • Like 1
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...