Fabioxps Posted March 18, 2013 Share 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 ) Link to comment
MIKI785 Posted March 18, 2013 Share Posted March 18, 2013 If it's client side there's argument in createExplosion to toggle damage. Link to comment
iPrestege Posted March 18, 2013 Share 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) Link to comment
PaiN^ Posted March 18, 2013 Share Posted March 18, 2013 (edited) createExplosion ( pX, pY, pZ, 6, true, true, false ) Edited March 18, 2013 by Guest Link to comment
TAPL Posted March 18, 2013 Share Posted March 18, 2013 createExplosion ( pX, pY, pZ, 6, hitPlayer, true, true, false ) This server side or client side? Link to comment
PaiN^ Posted March 18, 2013 Share Posted March 18, 2013 (edited) Client .. EDIT : oh i saw the error , Thanx TAPL Edited March 18, 2013 by Guest Link to comment
Fabioxps Posted March 18, 2013 Author Share 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 Link to comment
TAPL Posted March 18, 2013 Share Posted March 18, 2013 Client .. Did you read the wiki? Because in client side there no creator argument. Link to comment
iPrestege Posted March 18, 2013 Share Posted March 18, 2013 You Are Create The Explosion In Client And Server Side? LoL? Link to comment
Fabioxps Posted March 18, 2013 Author Share Posted March 18, 2013 this script is for a map when the player arrives on site to create a exploasao Link to comment
Fabioxps Posted March 18, 2013 Author Share Posted March 18, 2013 where is the error? Link to comment
PaiN^ Posted March 19, 2013 Share 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 .. Link to comment
Castillo Posted March 19, 2013 Share 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 ) Link to comment
Fabioxps Posted March 19, 2013 Author Share Posted March 19, 2013 I have not tested yet but thanks 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