Forum

> > CS2D > Scripts > Script Wrong
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Script Wrong

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Script Wrong

Black99
User Off Offline

Zitieren
This is the script
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
houses = {Member = {138,139},
		  Admin = {15,145}}
function lvl(id)
	local filename = "sys/lua/admin.txt"
	local file = io.open(filename)
	if file then
		for line in file:lines() do
			local parses = totable(line)
			if tonumber(parses[1]) ~= nil then
				if player(id,"usgn") == tonumber(parses[1]) then
					if parses[2] ~= nil then
						if parses[2] == "member" then
							return 1
						elseif parses[2] == "mod" then
							return 2
						elseif parses[2] == "gamemaster" then
							return 3
						elseif parses[2] == "admin" then
							return 4
						end
					else
						return 0
					end
				end
			end
		end
function telmenu(id)
	menu(id,"Teleport,Member House,Admin House")
		end
	end
end
	elseif t == "Teleport" then
		if b == 1 then
			if level[id] >= 1 then
				if player(id,"health") > 0 then
					parse("setpos "..id.." "..(houses.Member[1]*32).." "..(houses.Member[2]*32))
				end
			else
				noadm(id)
			end
		elseif b == 2 then
			if level[id] >= 3 then
				if player(id,"health") > 0 then
					parse("setpos "..id.." "..(houses.Admin[1]*32).." "..(houses.Admin[2]*32))
				end
			else
				noadm(id)
			end
		end
	end
end
And this Is The Error
1
LUA ERROR : lua:32:'oef' expected near 'elseif'
Please Help

alt Re: Script Wrong

XoOt
Super User Off Offline

Zitieren
You used too many ends. That error explains it very well, so you basically have to check those ends above line 32. Im not going to tell you the whole solution or fix it for you, because it's always better to learn it by yourself.
2× editiert, zuletzt 15.03.15 17:35:24

alt Re: Script Wrong

XoOt
Super User Off Offline

Zitieren
Btw. Try to use notepad++ to see the most mistakes in your scripts. It will help you to notice them.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht