• LUA Programming help 'checkpoint prospectus'
    1 replies, posted
Hi there, I have been programming in Lua for a while now but got stuck on trying to program a zone e.g like a checkpoint that scores the player a point? and also i know there is a randomization ability in the language but is it possible to get this score zone or circular checkpoint to spawn randomly on a map on the ground?
My memory is awful at remembering arguments for functions, but to find stuff inside an spherical area you can use: ents.FindInSphere(iRadius, vPos) It will return a table filled with entities inside that sphere. Check all the entities, if its a player, give him a point. For your other question, it's not really easy to say what the "ground" is on a map, unless it's some really generic map like flatgrass. You could do lots of checks and stuff to find a good ground spot, but I'd say that you should just set up a table filled with coordinates (for each map) and then randomize inbetween them.
Sorry, you need to Log In to post a reply to this thread.