#no clue how to summon an explosion

1 messages · Page 1 of 1 (latest)

paper adder
#

i wanna basically summon an explosion on the player on death
ive figured out how to summon a grenade with a timer (by ripping it from the example) but i dont know if it would be possible to summon just the raw explosive
This is the code for the grenade i found, if someone could help thatd be great

torn fjord
#

You want a grenade pickup?

paper adder
#

no i just want an explosion to spawn

#

not a grendade but just like

#

the explosion itself

torn fjord
#

You need a grenade

paper adder
#

oh okay so theres no way to just spawn the raw explosion?

#

cause with the code above im able to spanw the grenade but it still have to go through the timer

#

i want the explosion to be instantanious

torn fjord
#

Something like this should work i think

TimedGrenadeProjectile grenade = (TimedGrenadeProjectile)Projectile.Create(ItemType.GrenadeHE, ev.Player.Position);
    grenade.FuseEnd();
paper adder
#

alr ill try it

civic finch
paper adder
#

alright, is there any way to add the damage effects too?

civic finch
#

Check the methods of the class

#

I can't recall it by name but you can do that

paper adder
#

something like this?

torn fjord
civic finch
#

You can't cast LabApi wrappers to base game stuff
Use Projectile.Create(...).Base
Also, isn't there a wrapper for Grenade projectiles? It would be more ideal to use that

paper adder
#

the wrapper might be explosiongrenade but ill check

#

yea explosive grenade projectile

#

omg this might be it

civic finch
#

Yup

paper adder
#

testing now

civic finch
#

Yeah that looks good

paper adder
#

IT WORKED
omg

#

you guys are amazing thank you