Forum

> > CS2D > Scripts > Teleport to a player
Forums overviewCS2D overview Scripts overviewLog in to reply

English Teleport to a player

2 replies
To the start Previous 1 Next To the start

old Teleport to a player

HedShot
User Off Offline

Quote
Hi all!

I need a script that you can teleport players. Can you help me? Thanks in advance. I got this far, but it does not work:

1
2
3
4
5
addhook("say","asay")
addhook("sayteam","asay")

function asay(id,message)
 if message[1]=="!tp" then
And it stuck. (sorry for my english, I'm hungary)
edited 1×, last 22.03.13 08:29:56 pm

old Re: Teleport to a player

EP
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
addhook("say","asay")
addhook("sayteam","asay")

function asay(id,message)
	if message:lower():sub(1,3)=="!tp" then
		local pl = tonumber(message:sub(5,6)) or 0 
		if pl > 0 and player(pl,"exists") then
			parse("setpos "..id.." "..player(pl,"x").." "..player(pl,"y"))
		end		
		return 1
	end
end
I guess this works...
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview