Forum

> > CS2D > Scripts > Customkill error
Forums overviewCS2D overview Scripts overviewLog in to reply

English Customkill error

4 replies
To the start Previous 1 Next To the start

old Customkill error

MikuAuahDark
User Off Offline

Quote
i have problem with customkill. i want create random damage. but it only shows "Player died" and not "Idlers M4A1 Player". i know there more than 1 thread about this, but im not found the solution, i was read thread cs2d Lua Error - Custom kill but it still not work!
my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Random damage by Rian2_idih

addhook("hit","randomdmg")
function randomdmg(id,pl,weapon,hp,ap)
	hpdmg = math.random(hp,hp+20)
	hpnoarmor = math.random(hp,hp+40)
	apdmg = math.random(ap,ap+12)
	if (player(id,"health")+hpdmg)>0 then
		if player(id,"armor")>0 then
			parse("sethealth "..id.." "..(player(id,"health")-hpdmg))
			parse("setarmor "..id.." "..(player(id,"armor")-apdmg))
		else
			parse("sethealth "..id.." "..(player(id,"health")-hpnoarmor))
		end
	else
		parse('customkill '..pl..' "..itemtype(weapon,"name").." '..id)
	end
	return 1
end

old closed Re: Customkill error

Glix
User Off Offline

Quote
This maybe help you! *ref link removed*

Admin/mod comment

Didn't you read in the rules, 'No ref links'? Well, adfly is ref links.

old Re: Customkill error

TimeQuesT
User Off Offline

Quote
1
2
3
parse ("customkill "..pl.." "..itemtype(weapon("name")).." "..id);
--or
parse ('customkill '..pl..' '..itemtype(weapon('name'))..' '..id);

You don't have to qoute the killweaponname.

old Re: Customkill error

Zins
User Off Offline

Quote
user TimeQuesT has written
1
2
3
parse ("customkill "..pl.." "..itemtype(weapon("name")).." "..id);
--or
parse ('customkill '..pl..' '..itemtype(weapon('name'))..' '..id);

You don't have to qoute the killweaponname.

IMG:https://myfacewhen.com/77/

u are good
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview