Forum

> > CS2D > General > flamethrower heal
Forums overviewCS2D overviewGeneral overviewLog in to reply

English flamethrower heal

28 replies
Page
To the start Previous 1 2 Next To the start

old Re: flamethrower heal

ohaz
User Off Offline

Quote
it's made with Lua.
I think they used the "hit" hook, checked if the weapon has the id of the flamethrower, and if it's so, they set the health of the player up:
1
2
3
4
5
6
addhook("hit", "flamethrower_heal")
function flamethrower_heal(id,source,weapon,hpdmg,apdmg)
	if (weapon == 46)
		player(id, "health") = player(id, "health")+10
	end
end

old Re: flamethrower heal

ohaz
User Off Offline

Quote
easiest way would be to just copy it to the bottom of the server.lua but it's confusing this way.
create a new file:
flame_heal.lua
paste the code there
and save it to CS2DFOLDER/sys/lua
and add the following line to the bottom of the server.lua
1
dofile("sys/lua/flame_heal.lua")

old Re: flamethrower heal

Thomazz
User Off Offline

Quote
Do u have activate the Lua Script ? if the thing that TKD said not work try to do it ingame under Options in the Main Menu (only if u are the Server)

old Re: flamethrower heal

Todesengel
User Off Offline

Quote
i Become a Error in the File.. wait..

     Edit,
1
2
3
4
5
6
addhook("hit", "flamethrower_heal") 
function   flamethrower_heal(id,source,weapon,hpdmg,apdmg) 
     if (weapon == 46) then 
          player(id, "health") = player(id, "health")+10 
     end 
end

old Re: flamethrower heal

MiroslavR
User Off Offline

Quote
Try:

1
2
3
4
5
6
addhook("hit", "flamethrower_heal") 
function flamethrower_heal(id,source,weapon,hpdmg,apdmg) 
   	 if (weapon == 46) 
      	    	parse("sethealth "..id.." "..player(id, "health")+10)
	end
end

old Re: flamethrower heal

ohaz
User Off Offline

Quote
oh, yes I'm sorry, I didn't really think while making this script, so I mixed some things.
The script by MiroslavR should work

old Re: flamethrower heal

MiroslavR
User Off Offline

Quote
TheKilledDeath has written
oh, yes I'm sorry, I didn't really think while making this script, so I mixed some things.
The script by MiroslavR should work

Well, not really. I have forgotten "then", lol :(.
" if (weapon == 46) then " !
To the start Previous 1 2 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview