First commit
This commit is contained in:
		@@ -0,0 +1,28 @@
 | 
			
		||||
function onSay(player, words, param)
 | 
			
		||||
	if not player:getGroup():getAccess() then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local steps = tonumber(param)
 | 
			
		||||
	if not steps then
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local position = player:getPosition()
 | 
			
		||||
	position:getNextPosition(player:getDirection(), steps)
 | 
			
		||||
	
 | 
			
		||||
	position = player:getClosestFreePosition(position, false)
 | 
			
		||||
	if position.x == 0 then
 | 
			
		||||
		player:sendCancelMessage("You cannot teleport there.")
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	local tile = Tile(position)
 | 
			
		||||
	if tile == nil or tile:getGround() == nil then
 | 
			
		||||
		player:sendCancelMessage("You cannot teleport there.")
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	player:teleportTo(position)
 | 
			
		||||
	return false
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user