Forum

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

English Script error

8 replies
To the start Previous 1 Next To the start

old Script error

Leonidas12
User Off Offline

Quote
this is my script and very much errors help me

More >

old Re: Script error

Bowlinghead
User Off Offline

Quote
Delete the
1
_startround()
at the end!

EDIT:
Delete the "score_ct" and "score_t" because u failed!

old Re: Script error

Leonidas12
User Off Offline

Quote
user Bowlinghead has written
Delete the
1
_startround()
at the end!

EDIT:
Delete the "score_ct" and "score_t" because u failed!


this is not worked
1
LUA ERROR: sys/lua/MDV2.lua:32: 'end' expected (to close 'if' at line 11) near '<eof>'
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
addhook("serveraction" , "_serveraction")
addhook("menu","_menu")
addhook("startround" , "_startround")


function _serveraction(id,action)
     menu(id,"Shotgun Pro Buy,Buy Shotgun,Buy Armor,Buy HE")
end

function _menu(id,title, button)
     if title=="Shotgun Pro Buy" then
          elseif button==1 then
               if player(id,"money")>=2000 then
                    parse("equip "..id.." 11 ")
                    parse("setmoney "..id.." "..player(id,"money")-2000)
               end
          elseif button==2 then
               if player(id,"money")>=8500 then
                    parse("equip "..id.." 58 ")
                    parse("setmoney "..id.." "..player(id,"money")-8500)
               end
          elseif button==3 then
               if player(id,"money")>=13000 then
                    parse("equip "..id.." 51 ")
                    parse("setmoney "..id.." "..player(id,"money")-8500)
               end

old Re: Script error

Bowlinghead
User Off Offline

Quote
<eof> = end of function

Add/Delete a end.

Every "if", "function" and "for" needs 1 end!

old Re: Script error

Cure Pikachu
User Off Offline

Quote
Corrected.
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
addhook("serveraction","_serveraction")
addhook("menu","_menu")
addhook("startround","_startround")

function _serveraction(id,action)
	menu(id,"Shotgun Pro Buy,Buy Shotgun,Buy Armor,Buy HE")
end

function _menu(id,title,button)
if title=="Shotgun Pro Buy" then
	if button==1 then -- Removed the else part
		if player(id,"money")>=2000 then
			parse("equip "..id.." 11 ")
			parse("setmoney "..id.." "..player(id,"money")-2000)
		end
	elseif button==2 then
		if player(id,"money")>=8500 then
			parse("equip "..id.." 58 ")
			parse("setmoney "..id.." "..player(id,"money")-8500)
		end
	elseif button==3 then
		if player(id,"money")>=13000 then
			parse("equip "..id.." 51 ")
			parse("setmoney "..id.." "..player(id,"money")-8500)
		end
	end -- Added
end -- Added

function _startround()
	parse("hudtxt 1 \"©255255255CT's Score "..game("score_ct").."\" 300 458")
	parse("hudtxt 2 \"©255255255T's Score "..game("score_t").."\" 200 458")
end

old Re: Script error

Leonidas12
User Off Offline

Quote
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
addhook("serveraction" , "_serveraction")
addhook("menu","_menu")
addhook("startround" , "_startround")


function _serveraction(id,action)
     menu(id,"Shotgun Pro Buy,Buy Shotgun,Buy Armor,Buy HE")


function _menu(id,title, button)
     if title=="Shotgun Pro Buy" then
          elseif button==1 then
               if player(id,"money")>=2000 then
                    parse("equip "..id.." 11 ")
                    parse("setmoney "..id.." "..player(id,"money")-2000)
               end
          elseif button==2 then
               if player(id,"money")>=8500 then
                    parse("equip "..id.." 58 ")
                    parse("setmoney "..id.." "..player(id,"money")-8500)
               end
          elseif button==3 then
               if player(id,"money")>=13000 then
                    parse("equip "..id.." 51 ")
                    parse("setmoney "..id.." "..player(id,"money")-8500)
               end
LUA ERROR: sys/lua/MDV2.lua:32: 'end' expected (to close 'function' at line 9) near '<eof>'

error

old ><

shotnine
User Off Offline

Quote
:facepalm:
title~=button

old Re: Script error

Apache uwu
User Off Offline

Quote
I believe I had solved your problem.

thread trash Shotgun pro √

More >
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview