Fabioxps Posted March 18, 2013 Posted March 18, 2013 how can I cause an explosion that will not harm the player local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit(hitPlayer, matchingDimension) local pX, pY, pZ = getElementPosition ( source ) createExplosion ( pX, pY, pZ, 6, hitPlayer ) end addEventHandler( 'onColShapeHit', zone, shapeHit )
MIKI785 Posted March 18, 2013 Posted March 18, 2013 If it's client side there's argument in createExplosion to toggle damage.
iPrestege Posted March 18, 2013 Posted March 18, 2013 -- Example 2: This will cause an explosion that will not harm the player. Wiki! function fakeBomb(x,y,z,d) if d then --Check the players Dimension if getElementDimension(getLocalPlayer()) == d then --If the players Dimension is the current dimension --Then people on other dimensions cant see this explosion createExplosion(x, y, z, 0, true, -1.0, false) end else createExplosion(x,y,z,0,true,-1.0,false) end end addEvent("fakeBomb",true) addEventHandler("fakeBomb",getRootElement(),fakeBomb)
PaiN^ Posted March 18, 2013 Posted March 18, 2013 (edited) createExplosion ( pX, pY, pZ, 6, true, true, false ) Edited March 18, 2013 by Guest
TAPL Posted March 18, 2013 Posted March 18, 2013 createExplosion ( pX, pY, pZ, 6, hitPlayer, true, true, false ) This server side or client side?
PaiN^ Posted March 18, 2013 Posted March 18, 2013 (edited) Client .. EDIT : oh i saw the error , Thanx TAPL Edited March 18, 2013 by Guest
Fabioxps Posted March 18, 2013 Author Posted March 18, 2013 (edited) function fakeBomb(x,y,z,d) if d then --Check the players Dimension if getElementDimension(getLocalPlayer()) == d then --If the players Dimension is the current dimension --Then people on other dimensions cant see this explosion createExplosion(x, y, z, 0, true, -1.0, false) end else createExplosion(x,y,z,0,true,-1.0,false) end end addEvent("fakeBomb",true) addEventHandler("fakeBomb",getRootElement(),fakeBomb) local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit(hitPlayer, matchingDimension) local pX, pY, pZ = getElementPosition ( source ) createExplosion ( pX, pY, pZ, 6, hitPlayer, true, true, false ) triggerClientEvent ( "fakeBomb", getRootElement(), x, y, z, 0 ) end addEventHandler( 'onColShapeHit', zone, shapeHit ) Edited March 18, 2013 by Guest
TAPL Posted March 18, 2013 Posted March 18, 2013 Client .. Did you read the wiki? Because in client side there no creator argument.
iPrestege Posted March 18, 2013 Posted March 18, 2013 You Are Create The Explosion In Client And Server Side? LoL?
Fabioxps Posted March 18, 2013 Author Posted March 18, 2013 this script is for a map when the player arrives on site to create a exploasao
PaiN^ Posted March 19, 2013 Posted March 19, 2013 If you created the explosion in server side, You can't stop it from causing damage ! You only can cancel the damage on client side ..
Castillo Posted March 19, 2013 Posted March 19, 2013 -- client side: function fakeBomb ( x, y, z ) createExplosion ( x, y, z, 0, true, -1.0, false ) end addEvent ( "fakeBomb", true ) addEventHandler ( "fakeBomb", getRootElement(), fakeBomb ) -- server side: local zone = createColSphere( 1588.1999511719, -1638.5, 15.10000038147, 15.0 ) function shapeHit ( hitPlayer ) triggerClientEvent ( root, "fakeBomb", root, getElementPosition ( hitPlayer ) ) end addEventHandler( 'onColShapeHit', zone, shapeHit )
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