Forum

> > CS2D > Scripts > !speed command error
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch !speed command error

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt !speed command error

KagamineLen
User Off Offline

Zitieren
im making a command that when you say !speed (value)
it will speedmod you to that value

i need help fixing it

[01:41:50] LUA ERROR: sys/lua/LuaScript.lua:19: '=' expected near 'end'

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
addhook('say', '_say')
function _say(id, text)

if text == '!help' then
parse('sv_msg2 '..id..' !speed [Value] -- Gives You a Speed with Value-XX')
parse('sv_msg2 '..id..' !equip [WPN-ID] -- Equip A XX-ID Weapon')
parse('sv_msg2 '..id..' !armor82 -- Gives You Medic Armor')
parse('sv_msg2 '..id..' !armor83 -- Gives You Super Armor')
parse('sv_msg2 '..id..' !laser -- Equip A Weapon')
end

if string.find(text,'!speed') then
local speed1 = text:sub(1,6)
if speed1 == '!speed' then
local speed2 = text:sub(8,10)
parse('speedmod '..id..' '..speed1)
end
return1
end


end

alt Re: !speed command error

Bowlinghead
User Off Offline

Zitieren
ROFL!

Script hat geschrieben
addhook('say', '_say')
function _say(id, text)

if text == '!help' then
parse('sv_msg2 '..id..' !speed [Value] -- Gives You a Speed with Value-XX')
parse('sv_msg2 '..id..' !equip [WPN-ID] -- Equip A XX-ID Weapon')
parse('sv_msg2 '..id..' !armor82 -- Gives You Medic Armor')
parse('sv_msg2 '..id..' !armor83 -- Gives You Super Armor')
parse('sv_msg2 '..id..' !laser -- Equip A Weapon')
end

if string.find(text,'!speed') then
local speed1 = text:sub(1,6)
if speed1 == '!speed' then
local speed2 = text:sub(8,10)
parse('speedmod '..id..' '..speed2)
end
return1
end


end


Your Script is correct but the "return1" is wrong
1× editiert, zuletzt 13.08.11 20:43:51

alt Re: !speed command error

Anti-Grav
User Off Offline

Zitieren
Hmm

1
parse('speedmod' '..id..' '..speed1')

I think that works. Because every word is in ' '. Sorry when not.

Edit:

MC_Bowlinghead's solution should work. It has to be return 1 with space.

alt Re: !speed command error

EngiN33R
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook('say', '_say')
function _say(id, text)
if text == '!help' then
parse('sv_msg2 '..id..' !speed [Value] -- Gives You a Speed with Value-XX')
parse('sv_msg2 '..id..' !equip [WPN-ID] -- Equip A XX-ID Weapon')
parse('sv_msg2 '..id..' !armor82 -- Gives You Medic Armor')
parse('sv_msg2 '..id..' !armor83 -- Gives You Super Armor')
parse('sv_msg2 '..id..' !laser -- Equip A Weapon')
end

if string.find(text,'!speed') then
local speed1 = text:sub(1,6)
if speed1 == '!speed' then
local speed2 = text:sub(8,10)
parse('speedmod '..id..' '..speed1)
end
return 1
end

end

You just needed to change
1
return1
to
1
return 1
in your code. Yeah.

alt Re: !speed command error

EngiN33R
Moderator Off Offline

Zitieren
@MC_Bowlinghead

I didn't read the further posts, I just fixed the error and only after noticed that you said the same.

alt Re: !speed command error

RAVENOUS
BANNED Off Offline

Zitieren
user EngiN33R hat geschrieben
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
addhook('say', '_say')
function _say(id, text)
if text == '!help' then
parse('sv_msg2 '..id..' !speed [Value] -- Gives You a Speed with Value-XX')
parse('sv_msg2 '..id..' !equip [WPN-ID] -- Equip A XX-ID Weapon')
parse('sv_msg2 '..id..' !armor82 -- Gives You Medic Armor')
parse('sv_msg2 '..id..' !armor83 -- Gives You Super Armor')
parse('sv_msg2 '..id..' !laser -- Equip A Weapon')
end

if string.find(text,'!speed') then
local speed1 = text:sub(1,6)
if speed1 == '!speed' then
local speed2 = text:sub(8,10)
parse('speedmod '..id..' '..speed1)
end
return 1
end

end

You just needed to change
1
return1
to
1
return 1
in your code. Yeah.


For right terming you might change

1
parse('sv_msg2 '..id..' !speed [Value] -- Gives You a Speed with Value-XX')

to

1
msg2(id,"!speed [Value] -- Gives You a Speed with Value-XX")

shorter and less confusion.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht