Thivenin Posted August 2, 2013 Share Posted August 2, 2013 hai all I wanted to do : when a player pass the marker "outOneVSOneMarkertoPrincipalInterior" his melee weapon got removed but it's not removing and it's not giving any error message here the script function removeOneVSOneWeapon ( markerhit, takeweapon ) if ( markerHit == outOneVSOneMarkertoPrincipalInterior ) then takeWeapon ( thePlayer, 2 ) takeWeapon ( thePlayer, 4 ) takeWeapon ( thePlayer, 5 ) takeWeapon ( thePlayer, 6 ) takeWeapon ( thePlayer, 8 ) takeWeapon ( thePlayer, 9 ) takeWeapon ( thePlayer, 10 ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) the createMarker "outOneVSOneMarkertoPrincipalInterior " is more up on the script page (there is 202 line so I won't give you all the script if everything is working except this part) and I didn't remove other melee weapon cus on the script there is only "pickup" these weapon help me pls if you have time ^^ Link to comment
Wei Posted August 2, 2013 Share Posted August 2, 2013 function removeOneVSOneWeapon ( markerhit, matchingDimension ) if ( markerhit == outOneVSOneMarkertoPrincipalInterior ) then takeWeapon ( thePlayer, 2 ) takeWeapon ( thePlayer, 4 ) takeWeapon ( thePlayer, 5 ) takeWeapon ( thePlayer, 6 ) takeWeapon ( thePlayer, 8 ) takeWeapon ( thePlayer, 9 ) takeWeapon ( thePlayer, 10 ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) You've defined markerhit, but you used makerHit Link to comment
Thivenin Posted August 2, 2013 Author Share Posted August 2, 2013 awww right ty, but now it's saying Bad argument @ 'takeWeapon' [Expected element at argument 1, go nil ] in every line of takeWeapon and when I take the marker Link to comment
golanu21 Posted August 2, 2013 Share Posted August 2, 2013 function removeOneVSOneWeapon ( markerhit, matchingDimension ) if ( markerhit == outOneVSOneMarkertoPrincipalInterior ) then takeWeapon ( source, 2 ) takeWeapon ( source, 4 ) takeWeapon ( source, 5 ) takeWeapon ( source, 6 ) takeWeapon ( source, 8 ) takeWeapon ( source, 9 ) takeWeapon ( source, 10 ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) try like this Link to comment
Thivenin Posted August 2, 2013 Author Share Posted August 2, 2013 ty both, I luf you, it's working ^^ I learn more and more about the scripting (I started yesterday ^^) Link to comment
golanu21 Posted August 2, 2013 Share Posted August 2, 2013 ty both, I luf you, it's working ^^ I learn more and more about the scripting (I started yesterday ^^) no problemo, when you make script on server side, change thePlayer, or localPlayer, in source 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