Forum

> > CS2D > Scripts > lua no works [ resolved ]'
Forums overviewCS2D overview Scripts overviewLog in to reply

English lua no works [ resolved ]'

9 replies
To the start Previous 1 Next To the start

old Re: lua no works [ resolved ]'

Apache uwu
User Off Offline

Quote
Looks fine:

When an admin shoots a player with a m3 it will deal 100 health damage points. However if the player is not an admin or is not using the m3, it will use the cs2d hit system and deal normal damage. (Unless mp_damagefactor is changed).

You must have your usid in the table for this to work properly.

1
admins={70746}

old Re: lua no works [ resolved ]'

Blunt
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
admins={70746} <--- YOUR USGN HERE  i have make this for you! 

 function admincheck(usgn)
 for num, val in iparis(admins) do
 if val==usgn then
 return true
 else
 return false
 end
 end
 end

 weaponid = 10
 weapondamage = 100

 addhook("hit","customdamage")
 function customdamage(id,pl,weapon)
 if admincheck(player(pl,"usgn"))~=false then
 if weapon==weaponid then
 if (player(id,"health")-weapondamage)>0 then
 parse("sethealth "..id.." "..(player(id,"health")-weapondamage))
 else
 parse("customkill "..pl.." \""..itemtype(weapon,"name").."\" "..id)
 end
 return 1
 end
 end
 end

Test now!

old Re: lua no works [ resolved ]'

Doctard
User Off Offline

Quote
i like how your saying "HOW" "help me PLEASE" and your not looking at the things we posted, either learn how to do lua or let a fellow mate do it for ya
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview