Jump to content

gui help


bartje01

Recommended Posts

Hey guys.

I have a little problem at my gui.

  
  if (source == buyweapondeagle) then 
     
    giveWeapon (getLocalPlayer(),24) 
  
    outputChatBox ("You've bought a deagle!") 
  end 
end 
  
addEventHandler ("onClientGUIClick",getRootElement(),guiClick) 
  

It only shows me the text but it's not giving me the deagle.

HOw to fix?

Yes this is client side.

Link to comment

Use this

CLIENT:

  
  if (source == buyweapondeagle) then 
    
    triggerServerEvent("giveWeaponToPlayer",getLocalPlayer()) 
  
    outputChatBox ("You've bought a deagle!") 
  end 
end 
  
addEventHandler ("onClientGUIClick",getRootElement(),guiClick) 
  

SERVER:

  
addEvent("giveWeaponToPlayer",true) 
addEventHandler("giveWeaponToPlayer",getRootElement(),function() 
giveWeapon(source,24) 
end 
  

I hope that works

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