Teleport doesn't work when changing world
#1
When teleporting to a new world, it won't teleport you to its destination. (even if you call it under the hook changing and/or changed)

The X, Y, Z cordinates are correct, since they work when i run the test command.

For example, these cordinates:
Code:
x: 1034.1873541002
y: 69
z: 660.55511181803

Here is the code:
function OnEntityChangedWorld(Entity, World)
	if Entity:IsPlayer() then
		if HasTeleported then
			local _name = Entity:GetName()
			local _zone = PlayersData[_name].zones
			
			Entity:TeleportToCoords(PortalsData.warps["".._zone].point.x, PortalsData.warps["".._zone].point.y, PortalsData.warps["".._zone].point.z)
			print("x: " .. PortalsData.warps["".._zone].point.x)
			print("y: " .. PortalsData.warps["".._zone].point.y)
			print("z: " .. PortalsData.warps["".._zone].point.z)
			Entity:SendMessage("You have been teleported!")
			IsWorld = false
			HasTeleported = false
		end
	end
	return false
end

I'm using the code from Portal v1 by Taugeshtu, but i improved it and fixed alot of issues (saving and stuff now works properly w/o giving out errors etc, but im going to re-create the storing to INI file to make it easier and user friendly, plus make it so you can modify it easier trough the web panel.)
Reply
Thanks given by:


Messages In This Thread
Teleport doesn't work when changing world - by JonnyBoy0719 - 10-10-2015, 09:25 AM



Users browsing this thread: 2 Guest(s)