Benevolence Posted October 5, 2011 Share Posted October 5, 2011 Okay so everyone hates that on Zombie servers when you ram the zombies, most of the times due to lag (i think) or slow speed, it just stops the car and damages it with doing little or no damage to zombies. How could I create a script that makes it so if you hit a zombie while in a moving vehicle in the direction that you are going, it makes the zombie fall (you run him over) and die? Also, if a vehicle is on top of a zombie, it instantly kills the zombie. So if a car falls from out of nowhere onto a zombie, instead of it falling on top then rolling aside of the zombie. Which would be realistic, you ram someone, full speed or not in real life and they will fall under the car. I mean look at this, lol vehicles on a zombie server = crap. I'm creating a zombie GM and I want to make it good and sort of realistic. Like that monster isn't heavy enough to crush them. Link to comment
Castillo Posted October 5, 2011 Share Posted October 5, 2011 (edited) -- client side: addEventHandler ( "onClientPedDamage", getRootElement(), function (attacker) if not attacker then return end if ( getElementType(source) == "ped" and getElementType(attacker) == "vehicle" ) then triggerServerEvent("killZombie",localPlayer,source) end end) -- server side: addEvent("killZombie",true) addEventHandler ( "killZombie", getRootElement (), function ( zombie ) if zombie and source then killPed ( zombie, source ) end end) Edited October 7, 2011 by Guest Link to comment
Benevolence Posted October 5, 2011 Author Share Posted October 5, 2011 Doesn't seem to make a difference and it's probably because of the warning: Bad argument @ 'getElementType' On if ( getElementType(attacker) == "vehicle" ) then Link to comment
Castillo Posted October 5, 2011 Share Posted October 5, 2011 Copy my script again, I forgot that they we're PED's . Link to comment
Benevolence Posted October 5, 2011 Author Share Posted October 5, 2011 It works pretty good, thanks. Though, when zombies pile up in front of your truck and you hit the gas, it won't let you go forward. But I guess this is good enough. Link to comment
Ignition Posted October 5, 2011 Share Posted October 5, 2011 Solid is a Pro scripter, My role model :>, *cough* check pms Tank *cough*. Link to comment
Benevolence Posted October 5, 2011 Author Share Posted October 5, 2011 Solid is a Pro scripter, My role model :>, *cough* check pms Tank *cough*. I didn't get any PM. Link to comment
qaisjp Posted October 6, 2011 Share Posted October 6, 2011 Okay, resent. Ignition don't post useless posts like saying "cough see posts" and "xxx is my rolemodel". That's what people call SPAM and it's absolutely not related to the topic. Also remove the image from your signature :> You stole it from AeroXbird LMFAO Tank, also do an if check to see if attacker exists (if not attacker then return end) Link to comment
Benevolence Posted October 6, 2011 Author Share Posted October 6, 2011 qaisjp is the check necessary? What's the point. And that's not AeroXBird's sig, I've seen it elsewhere so everyone is free to use it. 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