English Zombie Classes Bug

6 replies
Goto Page
To the start Previous 1 Next To the start
26.08.21 04:09:17 pm
Up
NanuPlayer
User
Offline Off
hello us

this script wont work for some reason when i press F2 it dont open.

Code:
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
--------------------------------------------------
-- Player Classes Script by Unreal Software     --
-- 28.02.2009 - www.UnrealSoftware.de           --
-- Adds Player Classes to your server           --
--------------------------------------------------

if sample==nil then sample={} end
sample.classes={}

-----------------------
-- INITIAL SETUP     --
-----------------------
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end
sample.classes.class=initArray(32)
function sample.classes.classmenu(id)
if act==1 then
     menu(id,"Select your Class,Normal Zombie,Chainsaw Zombie,Gas Zombie,Mad Zombie,Police Zombie,Trapper Zombie,(Death Bringer)")     
end
end


-----------------------
-- TEAM -> CLASS     --
-----------------------
addhook("team","sample.classes.team")
function sample.classes.team(id,team)
     if (team>0) then
          sample.classes.classmenu(id)
     end 
end


-----------------------
-- SERVERACTION      --
-----------------------
addhook("serveraction","sample.classes.serveraction")
function sample.classes.serveraction(id)
     sample.classes.classmenu(id)
end


-----------------------
-- CLASS SELECTION   --
-----------------------
addhook("menu","sample.classes.menu")
function sample.classes.menu(id,menu,sel)
     if (menu=="Select your Class") then
          if (sel>=0 and sel<=6) then
               sample.classes.class[id]=sel
               if (player(id,"health")>0) then
                    parse("killplayer "..id)
               end
          end
     end
end


-----------------------
-- SPAWN             --
-----------------------
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
     -- Normal Zombie
     if (sample.classes.class[id]<=1) then
          parse ("setmaxhealth "..id.." 100")
          parse ("setarmor "..id.." 0")
          return "86";
     end
     -- Chainsaw Zombie
     if (sample.classes.class[id]==2) then
          parse ("setmaxhealth "..id.." 125")
          parse ("setarmor "..id.." 0")
          parse ("speedmod "..id.." 10")
          return "85";
     end
     -- Gas Zombie
     if (sample.classes.class[id]==3) then
          parse ("setmaxhealth "..id.." 100")
          parse ("setarmor "..id.." 0")
          return "72,60";
     end
     -- Mad Zombie
     if (sample.classes.class[id]==4) then
          parse ("setmaxhealth "..id.." 150")
          parse ("setarmor "..id.." 75")
         parse ("speedmod "..id.." 25")
          return "86";
     end
     -- Police Zombie
     if (sample.classes.class[id]==5) then
          parse ("setmaxhealth "..id.." 75")
          parse ("setarmor "..id.." 0")
          return "1,79";
     end
     -- Trapper Zombie
     if (sample.classes.class[id]==6) then
          parse ("setmaxhealth "..id.." 50")
          parse ("setarmor "..id.." 25")
         parse ("speedmod "..id.." 10")
          return "77,87,54";
     end
end


if you can fix it please fix it.
Bad Life
26.08.21 04:13:24 pm
Up
Bowlinghead
User
Offline Off
More >
Share time limited free games here
26.08.21 04:18:54 pm
Up
NanuPlayer
User
Offline Off
@user Bowlinghead: thank you

you always help me
edited 2×, last 02.04.22 02:58:47 am
Bad Life
26.08.21 07:31:05 pm
Up
Mami Tomoe
User
Offline Off
Just learn Lua, it's not that hard.
All you have to do is receive the action pressed through the cs2d lua hook serveraction hook.
Just add
, action
in the end of the brackets.

And then just make sure the action is equal to 1 or any other number in order to open the menu.

It's a matter of adding 1 if statement.
Look at me standing, here on my own again
27.08.21 05:59:30 am
Up
NanuPlayer
User
Offline Off
@user Mami Tomoe: why dont you just write the code?
i cant learn lua i tried but its too much hard and i am bad scripter i need to know how to open this script with f2 no other buttons
edited 1×, last 02.04.22 02:59:03 am
Bad Life
27.08.21 06:50:22 am
Up
Mami Tomoe
User
Offline Off
Because you're relying too much on other people to do everything for you.

How old are you? 12?
I was 13 when I began learning Lua, and it wasn't hard at all.
Look at me standing, here on my own again
27.08.21 06:59:08 am
Up
NanuPlayer
User
Offline Off
@user Mami Tomoe: im 14 but script is really hard for me i tried to learn it before but i cant.
can you write the code? please.
Bad Life
To the start Previous 1 Next To the start