yesyesok Posted April 1, 2015 Author Share Posted April 1, 2015 please help, I want it like when a player touch the infernus he should die, when infernus is not even moving. Link to comment
JR10 Posted April 1, 2015 Share Posted April 1, 2015 You could try onClientVehicleCollision. Or you could try what unpredictable suggested, though, from my previous experiences, attaching a colshape is just "unpredictable" *BA DUM TSS* (had to, really..) Link to comment
Castillo Posted April 1, 2015 Share Posted April 1, 2015 addEventHandler ( "onClientVehicleCollision", root, function ( hit ) if ( hit == localPlayer ) then setElementHealth ( localPlayer, 0 ) end end ) Link to comment
yesyesok Posted April 2, 2015 Author Share Posted April 2, 2015 It's kill ped with other vehicle but not with train Link to comment
WhoAmI Posted April 2, 2015 Share Posted April 2, 2015 Well, trains doesn't have collision by themselfs - but I'm not sure. Just create colshape (createColShphere), attach it to the train and write function whick kills player when he hits the colshape attached to "onColShapeHit" event. Link to comment
Mr.unpredictable. Posted April 2, 2015 Share Posted April 2, 2015 Well, trains doesn't have collision by themselfs - but I'm not sure. Just create colshape (createColShphere), attach it to the train and write function whick kills player when he hits the colshape attached to "onColShapeHit" event. For train i think this will be fine createColRectangle Link to comment
yesyesok Posted April 2, 2015 Author Share Posted April 2, 2015 Can you explain how can i do this ? with example if possible Sorry i'm new to lua. Link to comment
Mr.unpredictable. Posted April 3, 2015 Share Posted April 3, 2015 Just do it like this and look at the example in the wiki, It's not that hard to understand createColRectangle or createColSphere attachElements() ---- to attach the col to the vehicle "onColShapeHit" killPed() Link to comment
yesyesok Posted April 4, 2015 Author Share Posted April 4, 2015 I know create col shape what i did is i created and train with create vehicle and then i attached the col shape to it is there any possible way where i can attach the col shape to every train like i don't want to write createvehicle everytime. Link to comment
ALw7sH Posted April 4, 2015 Share Posted April 4, 2015 addEventHandler( "onClientElementStreamIn", root, function () if getElementType(source) == "vehicle" then ... 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