Xwad Posted August 7, 2015 Posted August 7, 2015 Hi i want to make a script that makes possible that the vehicle will only blow if it has 0 % hp. Becaouse the vehicles blows if the hp is under 250%. What functions need i use for that?
GTX Posted August 7, 2015 Posted August 7, 2015 You can't. You can only "fake" value. local healthValue = (getElementHealth(vehicle)-250)/750*100 This will get vehicle's health 0-100. Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
Xwad Posted August 7, 2015 Author Posted August 7, 2015 ohh ok thanks.And one more question. How can i make that if i shoot with the rhino something (fir example an object) then the bullet will not blow? (i want to disable the rhinos bullet explosion if its hit something)
LabiVila Posted August 7, 2015 Posted August 7, 2015 You can just unbind the keys which it fires, so the rinho won't be able to shot at all
Moderators IIYAMA Posted August 8, 2015 Moderators Posted August 8, 2015 You can cancel the bullet explosion like this: addEventHandler("onClientExplosion",root, function (x,y,z,explosionType) if source == localPlayer and explosionType == 10 then local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getElementMode(vehicle) == 432 then cancelEvent() end end end) But how you want to check if it hits an object is up to you. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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