Ir para conteúdo
  • 0

(Ajuda) Systema de Profissao


BrunooMaciell

Pergunta

Eu queria uma ajuda no systema de profissao onde ele contem systema de level e eu queria pedi ajuda se teria como tira o systema de level dele?

 

Script(Creaturescript)

Spoiler

function onLook(cid, thing, position, lookDistance)

local t = {
{name = "engenheiro", storage = 12012, value = 1},
{name = "professor", storage = 12013, value = 1},
{name = "aventureiro", storage = 12014, value = 1},
{name = "estilista", storage = 12015, value = 1},
}

for _, prof in ipairs(t) do

if isPlayer(thing.uid) then

if getPlayerStorageValue(thing.uid, prof.storage) >= prof.value and thing.uid ~= cid then
local textx = "This player is "..prof.name.." (Level "..getPlayerStorageValue(thing.uid, prof.storage)..")."
doPlayerSendTextMessage(cid, 22, textx) 
end

if getPlayerStorageValue(thing.uid, prof.storage) >= prof.value and thing.uid == cid then
local text = "You are "..prof.name.." (Level "..getPlayerStorageValue(thing.uid, prof.storage)..")."
doPlayerSendTextMessage(cid, 22, text) 
end

end

end

return true
end

Script(NPC)

Spoiler

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                    npcHandler:onThink()                    end
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local t = {
{name = "engenheiro", storage = 12012, value = 1},
{name = "professor", storage = 12013, value = 1},
{name = "aventureiro", storage = 12014, value = 1},
{name = "estilista", storage = 12015, value = 1},
}
for _, prof in ipairs(t) do
    if(msgcontains(msg, ''..prof.name..'')) then
              if getPlayerStorageValue(cid, 15393) <= 0 then
              setPlayerStorageValue(cid, prof.storage, prof.value)
              setPlayerStorageValue(cid, 15393, 1)
              doSendMagicEffect(getPlayerPosition(cid), 12)
              selfSay('Now you is '..prof.name..'.', cid)
    talkState[talkUser] = 0
              else
              selfSay('You already has a profession.', cid)   
    talkState[talkUser] = 0    
              end
              end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Rep++

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Tipo assim?

local t = {    {name = "engenheiro", storage = 12012, value = 1},    {name = "professor", storage = 12013, value = 1},    {name = "aventureiro", storage = 12014, value = 1},    {name = "estilista", storage = 12015, value = 1},}function onLook(cid, thing, position, lookDistance)    for _, prof in ipairs(t) do        if isPlayer(thing.uid) then            if getPlayerStorageValue(thing.uid, prof.storage) >= prof.value and thing.uid ~= cid then                local textx = "This player is "..prof.name.."."                                doPlayerSendTextMessage(cid, 22, textx)             end            if getPlayerStorageValue(thing.uid, prof.storage) >= prof.value and thing.uid == cid then                local text = "You are "..prof.name.."."                                doPlayerSendTextMessage(cid, 22, text)             end        end    end    return trueend

 

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...