Turbe$Z Posted October 16, 2016 Share Posted October 16, 2016 function giveWeaponsOnSpawn0 ( ) giveWeapon ( source, 31, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20 ) else outputChatBox("You do not have enough money.", source, 255, 0, 0, false) end addEvent( "giveweaponm4", true ) addEventHandler( "giveweaponm4", root, giveWeaponsOnSpawn0 ) what wrong in this? Link to comment
Gravestone Posted October 16, 2016 Share Posted October 16, 2016 There is no 'if' statement for 'else' at line 4. Try this: function giveWeaponsOnSpawn0 ( ) if getPlayerMoney(source) >= 20 then giveWeapon ( source, 31, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20 ) else outputChatBox("You do not have enough money.", source, 255, 0, 0, false) end end addEvent( "giveweaponm4", true ) addEventHandler( "giveweaponm4", root, giveWeaponsOnSpawn0 ) Link to comment
Turbe$Z Posted October 16, 2016 Author Share Posted October 16, 2016 11 minutes ago, Gravestone said: There is no 'if' statement for 'else' at line 4. Try this: function giveWeaponsOnSpawn0 ( ) if getPlayerMoney(source) >= 20 then giveWeapon ( source, 31, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20 ) else outputChatBox("You do not have enough money.", source, 255, 0, 0, false) end end addEvent( "giveweaponm4", true ) addEventHandler( "giveweaponm4", root, giveWeaponsOnSpawn0 ) 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