Jump to content

buy skin


BorderLine

Recommended Posts

Hi everyone. Well im trying to make a buy skin with a gui.

But my skin dont change.

This is my code

client

addEventHandler("onClientGUIClick",getRootElement(), 
  
function (player) 
            if (source == buyleon) then 
            money = getPlayerMoney (source) 
                if (money >= 500000) then 
                player = getLocalPlayer() 
                playSound ( "sounds/shop/thx.mp3", false ) 
                triggerServerEvent ("leon",getLocalPlayer(),leon) 
                else 
                playSound ( "sounds/shop/nocash.mp3", false ) 
                end 
end 
end) 

server

function leon () 
setElementModel ( source, 25,true ) 
takePlayerMoney(source,500000) 
end 
addEvent("leon",true) 
addEventHandler("leon",getRootElement(),leon) 

The skin dont change :/ and dont take money. If someone know what is my problem. Debug dont show erros

Link to comment
  
addEventHandler("onClientGUIClick",getRootElement(), 
function (player) 
            if (source == buyleon) then 
            money = getPlayerMoney (getLocalPlayer()) 
                if (money >= 500000) then 
                playSound ( "sounds/shop/thx.mp3", false ) 
                triggerServerEvent ("leon",getLocalPlayer()) 
                else 
                playSound ( "sounds/shop/nocash.mp3", false ) 
                end 
end 
end) 
  

  
function leon () 
setElementModel ( source, 25,true ) 
takePlayerMoney(source,500000) 
end 
addEvent("leon",true) 
addEventHandler("leon",getRootElement(),leon) 
  

Edit: Updated code.

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