Forum

> > CS2D > Scripts > Tilex and tiley
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Tilex and tiley

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Tilex and tiley

Mora
User Off Offline

Zitieren
Hello all !
i have problem with positions.
i need make menu if i go in position
for i 1,32 do
If tilex==30 and tiley==30 then
menu(id,blablalbala...) «with menu i have no problems»
please help me.

And one: i have this script
addhook("say","_say")
function _say(id,msg,word)
if player(id,"usgn") == 114940 then
msg("©255170128"..word)
end
end
it work...my chat massage is colored and if i say balalba@C then massage display in center... but i have this error in console:
LUA ERROR: sys/lua/Train.lua:13: attempt to concatenate local 'word' (a nil value)
Please help me with this.
Thanks you
1× editiert, zuletzt 05.08.13 17:44:59

alt Re: Tilex and tiley

Rainoth
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("movetile","tilemove")
function tilemove(id,x,y)
	if x == 30 and y == 30 then
		menu(id,blablalbala...)
	end
end

addhook("say","yas")
function yas(id,t)
	if player(id,"usgn")==114940 then
		msg("\169255170128"..t)
		return 1
	end
end
1× editiert, zuletzt 05.08.13 19:17:14

alt Re: Tilex and tiley

Dynamite07
User Off Offline

Zitieren
1
2
3
4
5
6
addhook("say","_say")
function _say(id,msg,word)
if player(id,"usgn") == 114940 then
msg("©255170128"..word)
end
end
You have function "msg" and "word", delete de function "msg" then should work.
And i think you would like to put "return 1"

user Rainoth hat geschrieben
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("movetile","tilemove")
function tilemove(id,x,y)
	if x == 30 and y == 30 then
		menu(id,blablalbala...)
	end
end

addhook("say","yas")
function yas(id,t)
	if player(id,"usgn")==114940 then
		msg("\169255170128"..t)
	end
end


He asked for help, not the code =l if he want to learn lua, lets teach him.

alt Re: Tilex and tiley

Rainoth
Moderator Off Offline

Zitieren
user Dynamite07 hat geschrieben
He asked for help, not the code =l if he want to learn lua, lets teach him.


Oh right. I forgot return 1. My bad.
As far as I know, he just needs his errors fixed, because he always gave error and the code and asked for help. After the fixed code, he'd always say "Thanks" and it would be end of the deal. I'm really sure that he's not trying to learn lua.

alt Re: Tilex and tiley

Dynamite07
User Off Offline

Zitieren
user Rainoth hat geschrieben
user Dynamite07 hat geschrieben
He asked for help, not the code =l if he want to learn lua, lets teach him.


Oh right. I forgot return 1. My bad.
As far as I know, he just needs his errors fixed, because he always gave error and the code and asked for help. After the fixed code, he'd always say "Thanks" and it would be end of the deal. I'm really sure that he's not trying to learn lua.


You're right , I would like to have a explication but i believe there are not many.

alt Re: Tilex and tiley

Mora
User Off Offline

Zitieren
Oh thanks you guys!
It work 150%!
I love you! (as scripters/helpers)
Thanks
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht