Forum

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

English Lua error

12 replies
To the start Previous 1 Next To the start

old Lua error

Big Bang Mafia
User Off Offline

Quote
Why this no work can someone tell me:
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
--------------------------
Created by BIG BANG MAFIA
HAVE FUN :D      
--------------------------

-----------
--Setings--  
-----------

parse("speedmod.."id".."15")
parse("setmaxhealth.."id".."150")
parse("mp_infammo "1")
parse("mp_building_limit "turret" 9999") 
parse("mp_building_limit "supply" 9999")
parse("mp_building_limit "gate field" 9999")  
parse("mp_building_limit "dispenser" 9999")
parse("sv_gamemode "3")  
parse("mp_antispeeder "1")  



if rand==nil then rand={} end
random={}
---------------
--Server Name--
---------------
addhook("team","random.title")
function random.title(id)
         parse('hudtxt2 '..id..' 9 "©160160255'..game("sv_name")..'" 260 26')    
end
-------
--MSG--    
-------
addhook("minute","random.msges")
function random.msges()
       msg("©190255050 ==Random Script") 
       msg("©190255050 ==Created by BIG BANG MAFIA")
       msg("©190255050 ==Dont Steal This")
       msg("©190255050 ==Have fun playing")  
       msg("©190255050 ==Visit my clan www.richclan.ucoz.com") 
end
--------
--move--
--------

addhook("move","random.move")
function random.move(id,x,y,walk)
rot = player(id,"rot")
parse('hudtxt2 '..id..' 3 "©000255000*Coordinates X: '..x..' Y: '..y..' " 13 105')
end 
addhook("movetile","random.movet")
function random.movet(id,x,y)
parse('hudtxt2 '..id..' 8 "©000255000*Tile Coordinates X: '..x..' Y: '..y..' " 13 130')
end  
-----------------------------
--       welcome msg       --
-----------------------------
addhook("team","random.team")
function random.team(p,tm)
	if tm==1 then
		msg2(p,"©000255000=Welcome to my server, "..player(p,"name").."!")
	end	
	if tm==2 then
		msg2(p,"©000255000=Welcome to my server, "..player(p,"name").."!")
		
	end
end

old Re: Lua error

J4x
User Off Offline

Quote
Does the console send you some error?

old Re: Lua error

Big Bang Mafia
User Off Offline

Quote
FN_Linkin Park has written
What does the error says?

LUA ERROR: sys/lua/Random.lua:2: '=' expected near 'by'

old Re: Lua error

J4x
User Off Offline

Quote
Edit: also i have to correct 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
--------------------------
-- Created by BIG BANG MAFIA
-- HAVE FUN :D
--------------------------

-----------
--Setings--
-----------

parse("speedmod "..id.." 15")
parse("setmaxhealth "..id.." 150")
parse("mp_infammo 1")
parse("mp_building_limit turret 9999")
parse("mp_building_limit supply 9999")
parse("mp_building_limit gate field 9999")
parse("mp_building_limit dispenser 9999")
parse("sv_gamemode 3")
parse("mp_antispeeder 1")



if rand==nil then rand={} end
random={}
---------------
--Server Name--
---------------
addhook("team","random.title")
function random.title(id)
parse('hudtxt2 '..id..' 9 "©160160255'..game("sv_name")..'" 260 26')
end
-------
--MSG--
-------
addhook("minute","random.msges")
function random.msges()
msg("©190255050 ==Random Script")
msg("©190255050 ==Created by BIG BANG MAFIA")
msg("©190255050 ==Dont Steal This")
msg("©190255050 ==Have fun playing")
msg("©190255050 ==Visit my clan www.richclan.ucoz.com")
end
--------
--move--
--------

addhook("move","random.move")
function random.move(id,x,y,walk)
rot = player(id,"rot")
parse('hudtxt2 '..id..' 3 "©000255000*Coordinates X: '..x..' Y: '..y..' " 13 105')
end
addhook("movetile","random.movet")
function random.movet(id,x,y)
parse('hudtxt2 '..id..' 8 "©000255000*Tile Coordinates X: '..x..' Y: '..y..' " 13 130')
end
-----------------------------
-- welcome msg --
-----------------------------
addhook("team","random.team")
function random.team(p,tm)
     if tm==1 then
          msg2(p,"©000255000=Welcome to my server, "..player(p,"name").."!")
     end
     if tm==2 then
          msg2(p,"©000255000=Welcome to my server, "..player(p,"name").."!")

     end
end
edited 1×, last 22.02.11 09:51:43 pm

old Re: Lua error

Big Bang Mafia
User Off Offline

Quote
It gives me this error:
1
LUA ERROR: sys/lua/Random.lua:10: ')' expected near 'id'

old Re: Lua error

Big Bang Mafia
User Off Offline

Quote
oh no now it give me this error:
1
LUA ERROR: sys/lua/Random.lua:10: attempt to concatenate global 'id' (a nil value)

old Re: Lua error

J4x
User Off Offline

Quote
Sorry but i can't find the problem i will try to solve it.

old Re: Lua error

EngiN33R
Moderator Off Offline

Quote
You're trying to set speedmod and maxhealth to player with 'id' ID, but the 'id' variable doesn't exist. Use this:

1
2
3
4
5
6
for id=1,32 do
if (player(id,"exists")) then
parse("speedmod "..id.." 15")
parse("setmaxhealth "..id.." 150")
end
end
Instead of just
1
2
parse("speedmod "..id.." 15")
parse("setmaxhealth "..id.." 150")
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview