Help with earthquake gamemode?

Ok, first of all, its frustrating that this is categorized as a “newbie question.” i mean come on, why cant we have a normal question section?

Anyway, I had an idea for a gamemode.

It is similar to BoingBoing/ find me’s flood mod. In a build phase players will build a creation of some sort to get them off the ground, be it a car, a tower, whatever. During a fight phase, players will shoot at each others contraptions to destroy them and knock players on to the ground, which will deal damage to players for each second they spend standing on it. This is what I need help with the most, making players take damage from the ground. Also, there is an earthquake mod on that i want to throw in. Hopefully, I will be able to code it so that earthquakes randomly happen during the fight phase, tossing players, undoing welds, etc.

Im unexperienced with lua, but i think ill do fine. all i need is a little help :slight_smile: thanks in advance.

To detect if they’re touching the ground use Entity.OnGround. You could also detect if they’re at or below a certain level with Entity.GetPos().z

It would probably be appropriate do do the checks in a Think() hook at a few moments intervals.

Thank you! I noticed that that returns true if the player is standing on a prop though…

Entity.GetPos() sounds like a better idea…

Just make sure all the maps for the gamemode have the floor at the same level.