Xwad Posted March 22, 2015 Share Posted March 22, 2015 Hi i want to make a script that makes a timer on every shoot with rpg or heatseeker. I mean if i shoot with an rpg or with a heatseeker after that i must wait 5 sec to shoot again. Link to comment
dewu Posted March 22, 2015 Share Posted March 22, 2015 Client: function reloadtazerclient ( weapon ) if (weapon == 35 or weapon == 36) then triggerServerEvent ( "ontazershoot", localPlayer ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, reloadtazerclient ) Server: function tazershootserverside ( ) setTimer(toggleControl, 5000, 1, source, "fire", false) toggleControl (source, "fire", true) end addEvent ( "ontazershoot", true ) addEventHandler ( "ontazershoot", root, tazershootserverside ) Link to comment
Xwad Posted March 22, 2015 Author Share Posted March 22, 2015 i cant shoot with the rpg and with the heatseeker. Link to comment
dewu Posted March 22, 2015 Share Posted March 22, 2015 Try this: function tazershootserverside ( ) toggleControl (source, "fire", false) setTimer(toggleControl, 5000, 1, source, "fire", true) end addEvent ( "ontazershoot", true ) addEventHandler ( "ontazershoot", root, tazershootserverside ) Link to comment
Xwad Posted March 23, 2015 Author Share Posted March 23, 2015 Its working Thanks a lot 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