Jump to content

[Help]Kill zombies within certain distance of you


kewizzle

Recommended Posts

Posted

Would it be possible to kill all zombies within a certain distance of you? if so how would i go about it? coding wise? I wanna use a dildo onWeaponFire cancels and does an animation with an createExplosion and kills zombies around me.

MTA:SA Scripting Is Fun!

spacer.png

  • Moderators
Posted (edited)
local peds = getElementsByType("ped", root, true)
for i=1, #peds do
	local ped = peds[i]
end

 

getDistanceBetweenPoints3D()

 

local x, y, z = getElementPosition(ped)
local x2, y2, z2 = getElementPosition(localPlayer)
killPed(ped)

 

etc.

 

https://wiki.multitheftauto.com/wiki/Scripting_Introduction

Edited by IIYAMA

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...