function OnUse(pGO, event, player)
if (player:HasItem(ItemId)) then
player:RemoveItem(ItemId)
player:Teleport(map, x, y, z, o)
elseif (player:GetCoinage() >= 10000) then
playerealGoldCost(10000)
player:Teleport(map, x, y, z, o)
else
player:SendBroadcastMessage("You need either 1 Gold or 1 Token to teleport.")
end
end
RegisterGameObjectEvent(GOId, 4, "OnUse")