Forum

> > CS2D > Scripts > What is it ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English What is it ?

8 replies
To the start Previous 1 Next To the start

old What is it ?

Kirito2K
User Off Offline

Quote
Hi all , after a made any ideas topic , i got one , but some thing wrong ..

LUA ERROR: attempt to call a nil value

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
cheater = {120840}
godMode= {}

if cheat==nil then cheat={} end
cheat.fun={}

addhook("serveraction","cheat.fun.adminaction")
function cheat.fun.adminaction(id,b)
if b == 1 then
for _, usgn in ipairs(cheater) do
if player(id,'usgn') == usgn then
menu(id,"Cheater Menu,Speed,Item Packs,God mode")
return 1
end
end
end
end

addhook("menu","cheat.fun.cheaetermenu")
function cheat.fun.cheatermenu(id,t,b)
if t=="Cheater Menu" then
if b==1 then
menu(id,"Speed,Normal,50% Fast,100% Fast")
elseif b==2 then
menu(id,"Item Packs,Super Pack,Mega Pack,FN F2000 Pack,M4A1 Pack")
elseif b==3 and godMode[id]==0 then
msg2(id,"@2550 0210GodMode Activated")
godMode[id]=1
elseif b==1 and godMode[id]==1 then
msg2(id,"@2550 0210GodMode Deactivated")
godMode[id]=0
end
end
end

if t=="Item Packs" then
if b==1 then
parse("equip "..pl.." 45")
parse("equip "..pl.." 83")
parse("equip "..pl.." 3")
end
msg2(id,"©255000000Super Pack!@C")
if b==2 then
parse("equip "..pl.." 81")
parse("equip "..pl.." 3")
parse("equip "..pl.." 46")
parse("equip "..pl.." 47")
end
msg2(id,"©255000000Mega Pack!@C")
if b==3 then
parse("equip "..pl.." 10")
parse("equip "..pl.." 3")
parse("speedmod "..pl.." 5")
end
msg2(id,"©255000000Super Pack!@C")
if b==4 then
parse("equip "..pl.." 91")
parse("equip "..pl.." 3")
parse("equip "..pl.." 82")
end
msg2(id,"©255000000FN F2000 Pack!@C")
if b==5 then
parse("equip "..pl.." 32")
parse("equip "..pl.." 30")
parse("equip "..pl.." 3")
parse("equip "..pl.." 80")
end
msg2(id,"©255000000M4A1 Pack!@C")
end

addhook("hit","cheat.fun._hit")
function cheat.fun._hit(id)
if godMode[id]==1 then
return 1
end
end

old Re: What is it ?

RedizGaming
GAME BANNED Off Offline

Quote
cheater = {120840}
godMode= {}
cheat = {}
cheat.fun = {}

addhook("serveraction","cheat.fun.adminaction")
function cheat.fun.adminaction(id,b)
if b == 1 then
for _, usgn in ipairs(cheater) do
if player(id,'usgn') == usgn then
menu(id,"Cheater Menu,Speed,Item Packs,God mode")
return 1
end
end
end
end

addhook("menu","cheat.fun.cheaetermenu")
function cheat.fun.cheatermenu(id,t,b)
if t=="Cheater Menu" then
if b==1 then
menu(id,"Speed,Normal,50% Fast,100% Fast")
elseif b==2 then
menu(id,"Item Packs,Super Pack,Mega Pack,FN F2000 Pack,M4A1 Pack")
elseif b==3 and godMode[id]==0 then
msg2(id,"@2550 0210GodMode Activated")
godMode[id]=1
elseif b==1 and godMode[id]==1 then
msg2(id,"@2550 0210GodMode Deactivated")
godMode[id]=0
end
end

if t=="Item Packs" then
if b==1 then
parse("equip "..pl.." 45")
parse("equip "..pl.." 83")
parse("equip "..pl.." 3")
end
msg2(id,"©255000000Super Pack!@C")
if b==2 then
parse("equip "..pl.." 81")
parse("equip "..pl.." 3")
parse("equip "..pl.." 46")
parse("equip "..pl.." 47")
end
msg2(id,"©255000000Mega Pack!@C")
if b==3 then
parse("equip "..pl.." 10")
parse("equip "..pl.." 3")
parse("speedmod "..pl.." 5")
end
msg2(id,"©255000000Super Pack!@C")
if b==4 then
parse("equip "..pl.." 91")
parse("equip "..pl.." 3")
parse("equip "..pl.." 82")
end
msg2(id,"©255000000FN F2000 Pack!@C")
if b==5 then
parse("equip "..pl.." 32")
parse("equip "..pl.." 30")
parse("equip "..pl.." 3")
parse("equip "..pl.." 80")
end
msg2(id,"©255000000M4A1 Pack!@C")
end
end

addhook("hit","cheat.fun._hit")
function cheat.fun._hit(id)
if godMode[id]==1 then
return 1
end
end

old Re: What is it ?

TopNotch
User Off Offline

Quote
- You assigned a empty variable called "GodMode". Afterwards you want to compare a number with a table value.
- You made a menu with 4 items, you made an if statement for a 5th button, which doesn't even exist.
- Please indent your code. Makes it easier to understand/read.
- Title of this topic is pretty senseless.

Fixed code. >

old Re: What is it ?

RedizGaming
GAME BANNED Off Offline

Quote
@user TopNotch:

addhook("join","_join")
function _join(id)
godMode[id] = false
end

u can use

for id = 1,32 do
     godMode[id] = false
end

old Re: What is it ?

Kirito2K
User Off Offline

Quote
Thanks all , now no problems , is it good script ?

Code [after adding some things]
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
cheater = {120840}
godMode = {}

addhook("join","_join")
function _join(id)
     godMode[id] = false
end

addhook("serveraction","_serveraction")
function _serveraction(id,act)
     if act == 1 then
          for _, usgn in ipairs(cheater) do
               if player(id,'usgn') == usgn then
                    menu(id,"Cheater Menu,Speed,Item Packs,God mode")
               end
          end
     end
end

addhook("menu","_menu")
function _menu(id,t,b)
     if t=="Cheater Menu" then
          if b==1 then
               menu(id,"Speed,Normal,50% Fast,100% Fast")
          elseif b==2 then
               menu(id,"Item Packs,Super Pack,Mega Pack, FN F2000 Pack,M4A1 Pack")
          elseif b==3 then
               if godMode[id]== false then
                    msg2(id,"©2550 0210GodMode Activated @C")
                    godMode[id] = true
               else
                    msg2(id,"©2550 0210GodMode deactivated @C")
                    godMode[id] = false
               end
          end
     elseif t=="Speed" then
          if b==1 then
               parse("speedmod "..id.." 0")
               msg2(id,"©255000000Normal Speed!")
          end
          if b==2 then
               parse("speedmod "..id.." 50")
               msg2(id,"©255000000Speed 50% Fast!")
          end
          if b==3 then
               parse("speedmod "..id.." 100")
               msg2(id,"©255000000Speed 100% Fast!@C")
          end
     elseif t=="Item Packs" then
          if b==1 then
               parse("equip "..id.." 45")
               parse("equip "..id.." 83")
               parse("equip "..id.." 3")
               msg2(id,"©255000000Super Pack!@C")
          end
          if b==2 then
               parse("equip "..id.." 81")
               parse("equip "..id.." 3")
               parse("equip "..id.." 46")
               parse("equip "..id.." 47")
               msg2(id,"©255000000Mega Pack!@C")
          end
          
          if b==3 then
               parse("equip "..id.." 91")
               parse("equip "..id.." 3")
               parse("equip "..id.." 82")
               msg2(id,"©2 5040709FN F2000 Pack!@C")
          end
          
          if b==4 then
               parse("equip "..id.." 32")
               parse("equip "..id.." 30")
               parse("equip "..id.." 3")
               parse("equip "..id.." 80")
               msg2(id,"©255 45090M4A1 Pack!@C")
          end
     end
end

addhook("hit","_hit")
function _hit(id)
     if godMode[id]==true then
          return 1
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview