Forum
CS2D Scripts Lua that i need.Lua that i need.
4 replies 1
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
"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.
1