Yakuzashi Posted September 1, 2018 Share Posted September 1, 2018 Hi. I wanted to finish PPSh-41 submachinge gun so I need it to shoot 3-4 projectiles with any chance of missing target. Now it can shoot just one bullet and it always hit the target. Any clues ? ppsh_smg.lua smgammo.lua Link to comment Share on other sites More sharing options...
K1NGT1GER609 Posted September 7, 2018 Share Posted September 7, 2018 Experiment with this. local CHANCEOFHITSUCCESS= 0.1 --low chance of hitting if math.random() <= local CHANCEOFHITSUCCESS= 0.1 then inst.components.weapon:SetDamage(10) else inst.components.weapon:SetDamage(0) end Link to comment Share on other sites More sharing options...
Yakuzashi Posted September 7, 2018 Author Share Posted September 7, 2018 Error message occurs. I have placed it in ppsh_smg.lua, should I place it somewhere else ? Link to comment Share on other sites More sharing options...
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