yesyesok Posted April 1, 2015 Author 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.
JR10 Posted April 1, 2015 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..)
Castillo Posted April 1, 2015 Posted April 1, 2015 addEventHandler ( "onClientVehicleCollision", root, function ( hit ) if ( hit == localPlayer ) then setElementHealth ( localPlayer, 0 ) end end )
yesyesok Posted April 2, 2015 Author Posted April 2, 2015 It's kill ped with other vehicle but not with train
WhoAmI Posted April 2, 2015 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.
Mr.unpredictable. Posted April 2, 2015 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
yesyesok Posted April 2, 2015 Author Posted April 2, 2015 Can you explain how can i do this ? with example if possible Sorry i'm new to lua.
Mr.unpredictable. Posted April 3, 2015 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()
yesyesok Posted April 4, 2015 Author 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.
ALw7sH Posted April 4, 2015 Posted April 4, 2015 addEventHandler( "onClientElementStreamIn", root, function () if getElementType(source) == "vehicle" then ... end end )
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