The Game Modding Community - Since 2001

Basic Explode On Hit Lua Code

A Config Script for Garry's Mod

12 lines | 374 bytes | Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
function KaboomOnHit( target, dmginfo )
    if ( target:IsNPC() ) then
       local explo = ents.Create( "env_explosion" )
       explo:SetPos( target:GetPos() )
       explo:Spawn()
       explo:Fire( "Explode" )
       explo:SetKeyValue( "IMagnitude", 20 )
       target:Ignite()
       end
    end
   
hook.Add("EntityTakeDamage", "ExplodeOnHit", KaboomOnHit)

Hello!

This Lua Code is for when you hit a NPC or the NPC get damaged, The NPC will Explode and Ignite.

You Can Create a .lua file and paste this Script Code to it.

To Disable the Code, You have to use this code:

hook.Remove( "EntityTakeDamage", "ExplodeOnHit" )

Posts

None found

Embed

Share banner
Image URL:
HTML embed code:
BB embed code:
Markdown embed code:

Credits

Creators
Lukaswbrr avatar
Lukaswbrr username pic Joined 3y ago
Offline
Making this script.

Submitter

Lukaswbrr avatar
Lukaswbrr username pic Joined 3y ago
Offline

Lukaswbrr avatar
Lukaswbrr

Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!
Sign up to access this!

Category

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • Share on Google+

Stats

  • 353 Views
  • 0 Posts
  • 2mo Submitted
  • 2mo Modified

Scores

  • Not yet rated
Sign up to access this!

Hey, you! Mascot

GameBanana is one of the oldest mod sites on the net. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation - send modders points.
  • Post: Give modders your thoughts on their work.
  • Vote: Help your favorite modders win monthly awards.
  • Rate: Rate mods and help them stand out.
  • Flag: Alert moderators and warn members of problems with mods.
  • Watch: Get notified when mods are updated.

Stop Lurking! Sign up now!

Already a Bananite? Login

bcp.crwdcntrl.net tracking pixel