roaddog Posted June 18, 2014 Share Posted June 18, 2014 Well heyo guys. I got a lil problem with this script, what am going to do is when the vehicle enters a the colshape, it will be destroyed and if the vehicle has a driver it won't be destroyed, but it doesnt work. Ima asking what should i do for this local myshape = createColCircle(1049.6279296875, -1029.674804687, 4) function ColHit(hitElement) thePlayer = getVehicleController ( hitElement) if (getElementType(hitElement) =="vehicle" ) and not (thePlayer) then destroyElement(hitElement) end end addEventHandler( "onColShapeHit", myshape, ColHit ) Thank you, and i hope it gonna be fixed as soon as possible though Link to comment
TAPL Posted June 18, 2014 Share Posted June 18, 2014 local myshape = createColCircle(1049.6279296875, -1029.674804687, 4) function ColHit(hitElement) if getElementType(hitElement) == "vehicle" then if not getVehicleController(hitElement) then destroyElement(hitElement) end end end addEventHandler("onColShapeHit", myshape, ColHit) Link to comment
roaddog Posted June 18, 2014 Author Share Posted June 18, 2014 Thanks for replying but it doesnt work Edit : I tried using tow truck, and it didnt work. but if i push the car, it worked Why? Link to comment
TAPL Posted June 18, 2014 Share Posted June 18, 2014 This is server side, so make sure you have it server side on the meta. Link to comment
roaddog Posted June 18, 2014 Author Share Posted June 18, 2014 Yeah, I have it server side on meta, but the prblem is still there Link to comment
Gtagasje Posted June 18, 2014 Share Posted June 18, 2014 If I read it right on the wiki, getVehicleController will check forwards in the 'towing chain' if the vehicle you're checking does not have a driver. So it should still return true because you're driving the towtuck which is forwards in the chain. (If that makes sense.) So you could use this local myshape = createColCircle(1049.6279296875, -1029.674804687, 4) function ColHit(hitElement) if getElementType(hitElement) == "vehicle" then if not getVehicleOccupant(hitElement) then destroyElement(hitElement) end end end addEventHandler("onColShapeHit", myshape, ColHit) Link to comment
roaddog Posted June 18, 2014 Author Share Posted June 18, 2014 Oh right. This is what im searching for. Thank you for helping 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