Forum

> > CS2D > Scripts > Lua that i need.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua that i need.

4 replies
To the start Previous 1 Next To the start

old Lua that i need.

_Vipersiax
User Off Offline

Quote
Zombie attacks human, human burns or tile burns something like that will give molotov effect in every 20seconds or etc.

old Re: Lua that i need.

-3Jlou_nTu4-
User Off Offline

Quote
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

old Re: Lua that i need.

DC
Admin Off Offline

Quote
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview