Forum

> > CS2D > Scripts > if player exits.. (lua)
Forums overviewCS2D overview Scripts overviewLog in to reply

English if player exits.. (lua)

9 replies
To the start Previous 1 Next To the start

old closed if player exits.. (lua)

limonata
User Off Offline

Quote
Hi all i was making a script but i need a help about this. Please check this codes.

1
2
3
4
5
6
7
8
9
10
11
if cmd == "!goto" then
		if player(pl,"exits") then
	   if pl ~= nil and pl ~= id then
			parse("setpos "..id.." "..player(pl,"x").." "..player(pl,"y"))
		else
			msg2(id,string.char(169).."255255000Correct syntax: !goto <id>")
			end
			else
			msg2(id,"No target!")
		end	
	end

It says all time "No target!" when i used !goto <id>

please help.

old Re: if player exits.. (lua)

Rainoth
Moderator Off Offline

Quote
user limonata has written
Hi all i was making a script but i need a help about this. Please check this codes.

1
2
3
4
5
6
7
8
9
10
11
if cmd == "!goto" then
		if player(pl,"exits") then
	   		if pl ~= nil and pl ~= id then
				parse("setpos "..id.." "..player(pl,"x").." "..player(pl,"y"))
			else
				msg2(id,string.char(169).."255255000Correct syntax: !goto <id>")
			end
		else
			msg2(id,"No target!")
		end	
	end

It says all time "No target!" when i used !goto <id>

please help.

Maybe because it has to check if player "exists" not "exits"

Always check the grammar.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview