English Lua that i need.

4 replies
Goto Page
To the start Previous 1 Next To the start
04.12.18 07:05:35 pm
Up
ExecutineR
User
Offline Off
Zombie attacks human, human burns or tile burns something like that will give molotov effect in every 20seconds or etc.
I Fixed It.
04.12.18 07:47:49 pm
Up
-3Jlou_nTu4-
User
Offline Off
local FIRE_DMG = 0     --burn dmg
local BURN_TIMER = 3      --seconds, how long player will be burns

local burn_once = {}
local burn_timer = {}

addhook("hit", "hit_proc")
addhook("join", "join_proc")

function burn(param)
     local plid = tonumber(param)
     if player(plid, "exists") and player(plid,"health")>0 then
          parse("effect "..'"fire"'.." "..tostring(player(plid, "x"))..' '..tostring(player(plid, "y"))..' 3, 16') -- FIRE EFFECT
          parse('sethealth '..tostring(plid)..' '..tostring(player(plid, "health")-FIRE_DMG/10))
          burn_timer[plid] = burn_timer[plid] - 1

          if burn_timer[plid]==0 then
               burn_once[plid] = true
          end
     else
          freetimer("burn", param)
          burn_once[plid] = true
     end
end

function join_proc(plid)
     if plid>=#burn_once then
          table.insert(burn_once, true)
          table.insert(burn_timer, 0)
     end
end

function hit_proc(plid, source, weapon, hpdmg, apdmg, rawdmg, objectid)
     if source==0 and objectid and burn_once[plid] then
          burn_timer[plid] = BURN_TIMER*10
          timer(100, "burn", tostring(plid), burn_timer[plid])
          burn_once[plid] = false
     end

     return 0
end
edited 1×, last 04.12.18 08:07:28 pm
04.12.18 07:54:26 pm
Up
ExecutineR
User
Offline Off
Not working..
I Fixed It.
04.12.18 10:19:20 pm
Up
DC
Admin
Offline Off
If you want help you should use proper titles for your thread. That's the minimum requirement. It's necessary to make this forum work.

"Lua that i need." = EXTREMLY generic = very bad. The only info there is that you need a Lua script. It does not say anything about the type of script you need. Imagine everyone would write Lua request threads like that. Pure chaos.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
06.12.18 06:27:26 pm
Up
ExecutineR
User
Offline Off
Got it
I Fixed It.
To the start Previous 1 Next To the start