Unique23 Posted February 17, 2014 Share Posted February 17, 2014 Hello Everyone! I decided to improve my Box skills script.I want script to show players the tactics when players buy a skill. Here is my script Server Side function learnboxx() local money = getPlayerMoney(source) if (money >=250) then takePlayerMoney(source,250) local status = setPlayerFightingStyle ( source, 5 ) outputChatBox ("You have succesfully bought Box skills",source,255,255,0) triggerClientEvent("oyuncuyaboxogret",source) else outputChatBox ("Sorry,You don't have enough money to buy this skill.!",source,255,255,0) end end addEvent("learnbox",true) addEventHandler("learnbox", root, learnboxx) This is my Client Side function boxogret() setTimer( function(player) setPedAnimation(player,"FIGHT_B","FightB_2") end,5000,1) end addEvent( "oyuncuyaboxogret", true ) addEventHandler( "oyuncuyaboxogret", getLocalPlayer(), boxogret ) MTA gives a Bad Argument warning at line 4 in client side.Thanks in advance Link to comment
Castillo Posted February 17, 2014 Share Posted February 17, 2014 function boxogret ( ) setTimer ( setPedAnimation, 5000, 1, localPlayer, "FIGHT_B", "FightB_2" ) end addEvent ( "oyuncuyaboxogret", true ) addEventHandler ( "oyuncuyaboxogret", getLocalPlayer(), boxogret ) Link to comment
Moderators Citizen Posted February 17, 2014 Moderators Share Posted February 17, 2014 For instance, you just forgot to send the player argument which is the source of the event in the setTimer. So you had to add source after 5000, 1 But it's useless to use a function when there is only one instruction in it. So use the Solidsnake's code instead. 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