alguem manja de como fazer esse script em talkactions que o player possa falar so se ele estiver com o item
local t = { ["tp1"] = {pos = {x = 32957, y = 32076, z = 7}, storage = 1337, time = 3}, ["tp2"] = {pos = {x = 32369, y = 32241, z = 7}, storage = 1338, time = 3}, ["tp3"] = {pos = {x = 32649, y = 31925, z = 11}, storage = 1339, time = 3}, ["tp4"] = {pos = {x = 32360, y = 31782, z = 7}, storage = 1340, time = 3}, ["tp5"] = {pos = {x = 32732, y = 31634, z = 7}, storage = 1341, time = 3}, ["tp6"] = {pos = {x = 32317, y = 32826, z = 7}, storage = 1342, time = 3}, ["tp7"] = {pos = {x = 32595, y = 32745, z = 7}, storage = 1343, time = 3}, ["tp8"] = {pos = {x = 33195, y = 32853, z = 8}, storage = 1344, time = 3}, ["tp9"] = {pos = {x = 33213, y = 32454, z = 1}, storage = 1345, time = 3}, ["tp10"] = {pos = {x = 33217, y = 31814, z = 8}, storage = 1346, time = 3}, ["tp11"] = {pos = {x = 32212, y = 31133, z = 7}, storage = 1347, time = 3}, ["tp12"] = {pos = {x = 32787, y = 31276, z = 7}, storage = 1348, time = 3}, ["tp13"] = {pos = {x = 33023, y = 31521, z = 11}, storage = 1349, time = 3}, ["tp14"] = {pos = {x = 33447, y = 31323, z = 9}, storage = 1350, time = 3}, ["tp15"] = {pos = {x = 33513, y = 32363, z = 6}, storage = 1351, time = 3}, ["tp16"] = {pos = {x = 32316, y = 31942, z = 7}, storage = 1352, time = 3}, ["tp17"] = {pos = {x = 33594, y = 31899, z = 6}, storage = 1353, time = 3}, ["tp18"] = {pos = {x = 9947, y = 9991, z = 7}, storage = 1354, time = 3} }
function onTextEdit(cid, item, newText) if item.itemid == 1947 then if isPlayerPzLocked(cid) then doCreatureSay(cid, "Voce esta em battle!", TALKTYPE_MONSTER) return false end if isInArray({'locais', 'lugares', 'lugar'}, newText) then local i = '' for text, x in pairs(t) do i = i .. "\n[" .. text .. "]" end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Locais de TP: " .. i) else local p = t[newText] if not p then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid location") return false end
local st = p.storage if getCreatureStorage(cid, st) > os.time() then doCreatureSay(cid, "Espere " .. getCreatureStorage(cid, st) - os.time() .. ' segundos' .. (getCreatureStorage(cid, st) - os.time() == 1 and "" or "s") .. "para viajar novamente.", TALKTYPE_MONSTER) return true end
local ti = p.time local pos = p.pos doTeleportThing(cid, pos, true) doSendMagicEffect(pos,72) doCreatureSetStorage(cid, st, os.time() + ti) doCreatureSay(cid, "Ultimate Teleport!", TALKTYPE_MONSTER) end end return true end
Pergunta
gusinhi 4
alguem manja de como fazer esse script em talkactions que o player possa falar so se ele estiver com o item
local t = {
["tp1"] = {pos = {x = 32957, y = 32076, z = 7}, storage = 1337, time = 3},
["tp2"] = {pos = {x = 32369, y = 32241, z = 7}, storage = 1338, time = 3},
["tp3"] = {pos = {x = 32649, y = 31925, z = 11}, storage = 1339, time = 3},
["tp4"] = {pos = {x = 32360, y = 31782, z = 7}, storage = 1340, time = 3},
["tp5"] = {pos = {x = 32732, y = 31634, z = 7}, storage = 1341, time = 3},
["tp6"] = {pos = {x = 32317, y = 32826, z = 7}, storage = 1342, time = 3},
["tp7"] = {pos = {x = 32595, y = 32745, z = 7}, storage = 1343, time = 3},
["tp8"] = {pos = {x = 33195, y = 32853, z = 8}, storage = 1344, time = 3},
["tp9"] = {pos = {x = 33213, y = 32454, z = 1}, storage = 1345, time = 3},
["tp10"] = {pos = {x = 33217, y = 31814, z = 8}, storage = 1346, time = 3},
["tp11"] = {pos = {x = 32212, y = 31133, z = 7}, storage = 1347, time = 3},
["tp12"] = {pos = {x = 32787, y = 31276, z = 7}, storage = 1348, time = 3},
["tp13"] = {pos = {x = 33023, y = 31521, z = 11}, storage = 1349, time = 3},
["tp14"] = {pos = {x = 33447, y = 31323, z = 9}, storage = 1350, time = 3},
["tp15"] = {pos = {x = 33513, y = 32363, z = 6}, storage = 1351, time = 3},
["tp16"] = {pos = {x = 32316, y = 31942, z = 7}, storage = 1352, time = 3},
["tp17"] = {pos = {x = 33594, y = 31899, z = 6}, storage = 1353, time = 3},
["tp18"] = {pos = {x = 9947, y = 9991, z = 7}, storage = 1354, time = 3}
}
function onTextEdit(cid, item, newText)
if item.itemid == 1947 then
if isPlayerPzLocked(cid) then
doCreatureSay(cid, "Voce esta em battle!", TALKTYPE_MONSTER)
return false
end
if isInArray({'locais', 'lugares', 'lugar'}, newText) then
local i = ''
for text, x in pairs(t) do
i = i .. "\n[" .. text .. "]"
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Locais de TP: " .. i)
else
local p = t[newText]
if not p then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Invalid location")
return false
end
local st = p.storage
if getCreatureStorage(cid, st) > os.time() then
doCreatureSay(cid, "Espere " .. getCreatureStorage(cid, st) - os.time() .. ' segundos' .. (getCreatureStorage(cid, st) - os.time() == 1 and "" or "s") .. "para viajar novamente.", TALKTYPE_MONSTER)
return true
end
local ti = p.time
local pos = p.pos
doTeleportThing(cid, pos, true)
doSendMagicEffect(pos,72)
doCreatureSetStorage(cid, st, os.time() + ti)
doCreatureSay(cid, "Ultimate Teleport!", TALKTYPE_MONSTER)
end
end
return true
end
Link para o comentário
Compartilhar em outros sites
12 respostass a esta questão
Posts Recomendados