-Blaze- Posted September 4, 2015 Share Posted September 4, 2015 Hey guys, I'm trying to make a script that can regulate the fire rate of various weapons without using ( setWeaponProperty ) , since the fire rate can only be changed on server side, but i want each player to have a different shooting speed. Any methods on how this can be done? Link to comment
Markeloff Posted September 4, 2015 Share Posted September 4, 2015 Why don't you use triggerServerEvent? Link to comment
-ffn-python Posted September 4, 2015 Share Posted September 4, 2015 Client-Side addEventHandler("onClientGUIClick",root, function() if source == ButtonName then triggerServerEvent("example", getLocalPlayer()) end end ) Server-Side addEvent("example") addEventHandler("example",root, function() setWeaponProperty(22, "poor", "weapon_range", 70) end ) Link to comment
JR10 Posted September 4, 2015 Share Posted September 4, 2015 allowRemoteTrigger must be set to true. addEvent("example", true) Link to comment
Moderators IIYAMA Posted September 6, 2015 Moderators Share Posted September 6, 2015 Hey guys,I'm trying to make a script that can regulate the fire rate of various weapons without using ( setWeaponProperty ) , since the fire rate can only be changed on server side, but i want each player to have a different shooting speed. Any methods on how this can be done? No. Only an overwrite in lua might make it possible. Which is far from real bullets and afaik not even close to your lua skills. Link to comment
Markeloff Posted September 6, 2015 Share Posted September 6, 2015 There's still some luck but, not really efficient as you wish. You can increase or decrease the client's gamespeed when firing a certain weapon, then you reset it to default when he stops firing. I know that doesn't change a weapon property, but it does it. speed = false function changeSpeed(weapon, _, _, _, _, _, _) if speed == false then setGameSpeed(4) speed = true addEventHandler("onClientRender",root,checkFiring) end end addEventHandler("onClientPlayerWeaponFire", root, changeSpeed) function checkFiring() if getPedTask ( localPlayer, "secondary", "TASK_SECONDARY_ATTACK" ) ~= "TASK_SIMPLE_USE_GUN" then removeEventHandler("onClientRender",root,checkFiring) speed = false setGameSpeed(1) end end 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