Forum

> > CS2D > Scripts > Tilex and tiley
Forums overviewCS2D overview Scripts overviewLog in to reply

English Tilex and tiley

6 replies
To the start Previous 1 Next To the start

old Tilex and tiley

Mora
User Off Offline

Quote
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
edited 1×, last 05.08.13 05:44:59 pm

old Re: Tilex and tiley

Rainoth
Moderator Off Offline

Quote
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
edited 1×, last 05.08.13 07:17:14 pm

old Re: Tilex and tiley

Dynamite07
User Off Offline

Quote
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 has written
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.

old Re: Tilex and tiley

Rainoth
Moderator Off Offline

Quote
user Dynamite07 has written
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.

old Re: Tilex and tiley

Dynamite07
User Off Offline

Quote
user Rainoth has written
user Dynamite07 has written
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.

old Re: Tilex and tiley

Mora
User Off Offline

Quote
Oh thanks you guys!
It work 150%!
I love you! (as scripters/helpers)
Thanks
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview