.
demo menumenu
Votar: Iniciado por ,
2

Miembro

3
![[Admin] God Maya](https://2img.net/u/2712/30/40/04/avatars/1-92.jpg)
Administrador


![[Ayuda] Puerta con vocacion YNU5B25](https://i.imgur.com/yNU5B25.png)
4

Miembro

No me hace nada, recordar que tengo la version tfs 1.3 con cliente 12.72 5

Miembro

Prueba
6

Miembro

No amigo, pero creo que tiene algo que ver con esta linea:
es como si pidiera un storage interno que indica que el jugador es esa vocacion.
Ya lo he solucionado!!! He escrito el código desde cero, por cierto podría hacer un tema sobre como hacer los cuartos de las vocaciones si me dierais permiso.
Gracias por intentarlo conmigo.
[Ayuda] Puerta con vocacion
2
Re: [Ayuda] Puerta con vocacion Miér Abr 20, 2022 2:23 pm
Dfsuno

Miembro

lo trae por defecto el 12 + creo se llama door_vocation
3 participantes
3
Re: [Ayuda] Puerta con vocacion Miér Abr 20, 2022 2:40 pm
[Admin] God Maya
![[Admin] God Maya](https://2img.net/u/2712/30/40/04/avatars/1-92.jpg)
Administrador

aqui tienes
- Código:
local post = Position(32179, 31899, 8)
local voc = {3, 4, 7, 8}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if isInArray(voc, player:getVocation():getId()) then
player:teleportTo(fromPosition, true)
return true
end
player:teleportTo(post)
return true
end

![[Ayuda] Puerta con vocacion YNU5B25](https://i.imgur.com/yNU5B25.png)
4
Re: [Ayuda] Puerta con vocacion Miér Mayo 11, 2022 10:58 pm
danigym

Miembro

[Admin] God Maya escribió:aqui tienes
- Código:
local post = Position(32179, 31899, 8)
local voc = {3, 4, 7, 8}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if isInArray(voc, player:getVocation():getId()) then
player:teleportTo(fromPosition, true)
return true
end
player:teleportTo(post)
return true
end
No me hace nada, recordar que tengo la version tfs 1.3 con cliente 12.72
3 participantes
5
Re: [Ayuda] Puerta con vocacion Jue Mayo 12, 2022 1:50 pm
Dfsuno

Miembro

- Código:
local vocationDoors = {
-- Sorcerer
[22001] = {
vocation = VOCATION.ID.SORCERER,
destination = {x = 32054, y = 31883, z = 6}
},
-- Druid
[22002] = {
vocation = VOCATION.ID.DRUID,
destination = {x = 32073, y = 31883, z = 6}
},
-- Paladin
[22003] = {
vocation = VOCATION.ID.PALADIN,
destination = {x = 32059, y = 31883, z = 6}
},
-- Knight
[22004] = {
vocation = VOCATION.ID.KNIGHT,
destination = {x = 32068, y = 31883, z = 6}
},
}
local vocationDoor = Action()
function vocationDoor.onUse(player, item, target, position, fromPosition)
local door = vocationDoors[item.uid]
--Check Oressa storage before choose vocation
if player:getStorageValue(Storage.Dawnport.DoorVocation) == door.vocation then
-- Remove Mainland smuggling items
removeMainlandSmugglingItems(player)
player:teleportTo(door.destination)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(
MESSAGE_EVENT_ADVANCE,
"Open the chest and take your gear, young " .. player:getVocation():getName():lower() .. "!"
)
elseif player:getStorageValue(Storage.Dawnport.DoorVocation) ~= door.vocation then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
end
return true
end
for index, value in pairs(vocationDoors) do
vocationDoor:uid(index)
end
vocationDoor:register()
Prueba

3 participantes
6
Re: [Ayuda] Puerta con vocacion Jue Mayo 12, 2022 3:24 pm
danigym

Miembro

Dfsuno escribió:
- Código:
local vocationDoors = {
-- Sorcerer
[22001] = {
vocation = VOCATION.ID.SORCERER,
destination = {x = 32054, y = 31883, z = 6}
},
-- Druid
[22002] = {
vocation = VOCATION.ID.DRUID,
destination = {x = 32073, y = 31883, z = 6}
},
-- Paladin
[22003] = {
vocation = VOCATION.ID.PALADIN,
destination = {x = 32059, y = 31883, z = 6}
},
-- Knight
[22004] = {
vocation = VOCATION.ID.KNIGHT,
destination = {x = 32068, y = 31883, z = 6}
},
}
local vocationDoor = Action()
function vocationDoor.onUse(player, item, target, position, fromPosition)
local door = vocationDoors[item.uid]
--Check Oressa storage before choose vocation
if player:getStorageValue(Storage.Dawnport.DoorVocation) == door.vocation then
-- Remove Mainland smuggling items
removeMainlandSmugglingItems(player)
player:teleportTo(door.destination)
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:sendTextMessage(
MESSAGE_EVENT_ADVANCE,
"Open the chest and take your gear, young " .. player:getVocation():getName():lower() .. "!"
)
elseif player:getStorageValue(Storage.Dawnport.DoorVocation) ~= door.vocation then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
end
return true
end
for index, value in pairs(vocationDoors) do
vocationDoor:uid(index)
end
vocationDoor:register()
Prueba![]()
No amigo, pero creo que tiene algo que ver con esta linea:
- Código:
if player:getStorageValue(Storage.Dawnport.DoorVocation) ~= door.vocation then
es como si pidiera un storage interno que indica que el jugador es esa vocacion.
Ya lo he solucionado!!! He escrito el código desde cero, por cierto podría hacer un tema sobre como hacer los cuartos de las vocaciones si me dierais permiso.
Gracias por intentarlo conmigo.
3 participantes
Temas similares
Permisos de este foro:
No puedes responder a temas en este foro.
|
|