Script to teleport/freeze/godmode.

Hi.

I would like a script that will, when you type a command, :
teleport the player to a place.
give godmode to the player.
freeze the player.

And when the player types the command again, he gets teleported back to his location, un-godmode and unfreezed.

I guess it’s like, on the command, you have to get the position, save it in a varible, and then teleport, god, freeze, when the player is back, you get the position from the varible.

[lua]
local telepos = Vector(10,10,10)

concommand.Add(‘telefreezegod’, function(ply, cmd, args)
if(!ply:IsAdmin() || !args[1]) then return end

for k, v in ipairs(player.GetAll()) do
	if(string.find(string.lower(v:Nick()), string.lower(args[1]))) then
		if(!v.OldPos) then
			v.OldPos = v:GetPos()
			v:SetPos(telepos)
			v:Lock()
			v:GodEnable()
		else
			v:UnLock()
			v:GodDisable()
			v:SetPos(v.OldPos)
			v.OldPos = nil
		end
	end
end

end)
[/lua]

Where do I enter where they should get teleported?

Have you tried line 1

Vector?
Shouldn’t I type like “getpos” in console, and enter the output?