Forum

> > CS2D > Scripts > my lua Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English my lua Script

3 replies
To the start Previous 1 Next To the start

old my lua Script

KagamineLen
User Off Offline

Quote
Can you fix my lua script for my server. it always had an error
here's the 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
function equip(id,wid)
	parse('equip '..id..' '..wid)
end

function setarmor(id,a)
	parse('setarmor '..id..' '..a)
end

function setmaxhealth(id,h)
	parse('setmaxhealth '..id..' '..h)
end

function sv_msg2(id,m)
	parse('sv_msg2 '..id..' '..m)
end

addhook("menu","Admins Menu")
function gmod_menu(id,t,b)

	if (t=="-= SpeedMod =-") then
		sv_msg2(id,/Rcon speed100)

		end
	end

	if (t=="-= Admin Equip =-") then
		sv_msg2(id,/Rcon admeqip)

		end

	end
	if (t=="-= Equip All =-") then
		sv_msg2(id,/Rcon equipall88)

		end
	end


	if (cmd==admeqip) then 
		equip(id,45)
		equip(id,46)
		equip(id,47)
		equip(id,48)
		equip(id,49)
		equip(id,50)
		equip(id,88)
		equip(id,87)
		equip(id,69)
		equip(id,85)
		equip(id,41)
		equip(id,3)
		equip(id,76)
		setarmor(id,205)
		setmaxhealth(id,250)
		return 1
	end

	if (cmd==Rcon equipall88) then 
		equip(id,1)
		equip(id,2)
		equip(id,3)
		equip(id,4)
		equip(id,5)
		equip(id,6)
		equip(id,7)
		equip(id,8)
		equip(id,9)
		equip(id,10)
		equip(id,11)
		equip(id,12)
		equip(id,13)
		equip(id,14)
		equip(id,15)
		equip(id,16)
		equip(id,17)
		equip(id,18)
		equip(id,19)
		equip(id,20)
		equip(id,21)
		equip(id,22)
		equip(id,23)
		equip(id,24)
		equip(id,25)
		equip(id,26)
		equip(id,27)
		equip(id,28)
		equip(id,29)
		equip(id,30)
		equip(id,31)
		equip(id,32)
		equip(id,33)
		equip(id,34)
		equip(id,35)
		equip(id,36)
		equip(id,37)
		equip(id,38)
		equip(id,39)
		equip(id,40)
		equip(id,41)
		equip(id,42)
		equip(id,43)
		equip(id,44)
		equip(id,45)
		equip(id,46)
		equip(id,47)
		equip(id,48)
		equip(id,49)
		equip(id,50)
		equip(id,51)
		equip(id,52)
		equip(id,53)
		equip(id,54)
		equip(id,55)
		equip(id,56)
		equip(id,57)
		equip(id,58)
		equip(id,59)
		equip(id,60)
		equip(id,61)
		equip(id,62)
		equip(id,63)
		equip(id,64)
		equip(id,68)
		equip(id,66)
		equip(id,67)
		equip(id,68)
		equip(id,69)
		equip(id,70)
		equip(id,71)
		equip(id,72)
		equip(id,73)
		equip(id,74)
		equip(id,75)
		equip(id,76)
		equip(id,77)
		equip(id,78)
		equip(id,79)
		equip(id,83)
		equip(id,88)
		return 1
	end

		if (cmd==speed100) then
		parse('speedmod '..id..' 100')
		return 1
	end

old Re: my lua Script

Homam
User Off Offline

Quote
75% Of the code is wrong, dude, if you want to learn lua, you should be ready to face the errors.

And the equip thingy should be like that;
1
parse("equip ".. id .." 49)

old Re: my lua Script

Bowlinghead
User Off Offline

Quote
no! Its wrong!

1
2
3
function equip(id,wid)
     parse('equip '..id..' '..wid)
end

But 74% of the Script is wrong!

old Re: my lua Script

Apache uwu
User Off Offline

Quote
Add an 'end' to the end of the lua script.

Fixed.

More >


Also it's not functional, you didn't add menu(id,"blahblahblah") but maybe you're just hiding the rest of the script idk.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview