Player spawn/LUA teleport question

I don’t really dabble in LUA but I need a quick function so I shall ask here.

function Teleport( ply )

ply:Teleportto(xyz)

end

The segment above should explain what I need. Can’t find a teleport function on the wiki.

[editline]24th October 2010[/editline]



function FirstSpawn( ply )
 
	ply:SetPos( 682,1521,216 )
	ply:SetLocalVelocity( Vector( 0, 0, 0 ) )
	
end
 
hook.Add( "PlayerInitialSpawn", "playerInitialSpawn", FirstSpawn )


Or just help me get that working :slight_smile:



function FirstSpawn( ply )
 
	ply:SetPos( Vector(682,1521,216) )
	ply:SetLocalVelocity( Vector( 0, 0, 0 ) )
	
end
 
hook.Add( "PlayerInitialSpawn", "playerInitialSpawn", FirstSpawn )


You might also want to tweak Z value abit if you get stuck.

Yea, I tried running that in a lua file from autorun.

However, since I suck I shall wait for the Tobba to awaken in the morning and just ask him todo it.

I simply want to teleport the player from spawn to another room. When spawning…

There is a weird reason for this, but alas it failed.