Hammer / Lua Question: Breakable prop.

Okay, First off, i’m a noob.
I am working on a gamemode right now. The gamemode is sort if like Unreal tournament. There are two teams, on each team there is a core in the base. When the core destroyed by gunfire, the round will end. By my question is:
— How would i go about making the prop breakable? Would i make the prop in Hammer, and then set the prop health to like 500? But if i did that, how would i make the LUA script end the round once the prop is destroyed?

Thanks in advanced!

I think you want a scripted entity. I’ve never used them in Hammer though, you need to ask someone else how that works.

Exactly. I need a scripted entity. When the entity breaks, the round ends.

So code it

That was really helpful.

What you are going to want to use is ENT.OnTakeDamage to hook all damage taken to your entity. Then apply variables accordingly to record the damage, and make it “break” when it hits 0.

Ok, i get the jist of what you are saying, although…
Where do i start script?

I would use Fretta. That would help with round management and general development.

I know a way of getting it to have a cinematic explosion rather than code it in lua to make the prop break. Requires a modeling program but, ah well.

Click Here.

You could have a special entity in hammer, that when your gamemode starts, it creates your core entity at the specified entity in your map…