Annas Posted June 23, 2016 Share Posted June 23, 2016 function testBinds() setPedWeaponSlot ( localPlayer, 2 ) setPedWeaponSlot ( localPlayer, 3 ) end bindKey("1", "down", testBinds) I need it when i click bind 1, the first time it will switch to slot:2 and when i click again on bind 1, it will switch to slot: 3 Please help me Link to comment
Overkillz Posted June 23, 2016 Share Posted June 23, 2016 Try this local current = 1 function testBinds() if current == 1 then setPedWeaponSlot ( localPlayer, 2 ) current = 2 elseif current == 2 then setPedWeaponSlot ( localPlayer, 3 ) current = 1 end end bindKey("1", "down", testBinds) Link to comment
MR.S3D Posted June 23, 2016 Share Posted June 23, 2016 i = false function testBinds() if not i then setPedWeaponSlot ( localPlayer, 2 ) else setPedWeaponSlot ( localPlayer, 3 ) end i = not i end bindKey("1", "down", testBinds) Link to comment
Annas Posted June 23, 2016 Author Share Posted June 23, 2016 Try this local current = 1 function testBinds() if current == 1 then setPedWeaponSlot ( localPlayer, 2 ) current = 2 elseif current == 2 then setPedWeaponSlot ( localPlayer, 3 ) current = 1 end end bindKey("1", "down", testBinds) HAHA, tooo simple and working ^^ , thanks Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now