Ir para conteúdo
  • 0

Script Ganhar Item Ao Upar Não Funcionando


Xubeiga

Pergunta

pessoal, estou usando esse script no meu OT, para ganhar 50k quanto upar level 50, mas ele não funciona! não aparece nenhum erro no executável, nada...como se ele não existisse. alguém pode ajudar a descobrir o erro? obs: eu uso MODERN AAC, e TFS 0.4

 

script de ganhar o item em creature scripts(UPGAIN.LUA):

function onAdvance(cid, skill, oldLevel, newLevel)
local config = {
[50] = {item = 2160, count = 5},
}

if skill == 8 then
for level, info in pairs(config) do
if newLevel >= level and (getPlayerStorageValue(cid, 30700) == -1 or not (string.find(getPlayerStorageValue(cid, 30700), "'" .. level .. "'"))) then
doPlayerAddItem(cid, info.item, info.count)
doPlayerSendTextMessage(cid, 27, "Parabéns Guerreiro você atingiu o level "..newLevel.." e ganhou "..info.count.." "..getItemNameById(info.item)..".")
local sat = getPlayerStorageValue(cid, 30700) == -1 and "Values: '" .. level .. "'" or getPlayerStorageValue(cid, 30700) .. ",'" .. level .. "'"
setPlayerStorageValue(cid, 30700, sat)
end
end
end

return TRUE
end

 

Creaturescripts.xml

<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" event="script" value="login.lua"/> <event type="advance" name="LevelItem" event="script" value="upgain.lua"/>

<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

<event type="think" name="Idle" event="script" value="idle.lua"/>
<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/></creaturescripts>

 

Login.lua

local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")

registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end

registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "LevelItem")[/size] registerCreatureEvent(cid, "VipCheck") registerCreatureEvent(cid, "TempleTeleporter") return true
end

 

simplesmente não acontece nada! alguém vê algum erro? valeu..

Editado por Xubeiga
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...