local table = {
[1] = 100,
[2] = 200,
[3] = 300,
[4] = 400,
[5] = 500,
[6] = 600
}
function onAdvance(cid, oldLevel, newLevel)
elseif getPlayerLevel(cid) == table.1 then
doBroadcastMessage("O jogador "..getPlayerName.." avançou para o level 100")
end
elseif getPlayerLevel(cid) == table.2 then
doBroadcastMessage("O jogador "..getPlayerName.." avançou para o level 200")
end
if getPlayerLevel(cid) == table.3 then
doBroadcastMessage("O jogador "..getPlayerName.." avançou para o level 300")
end
elseif getPlayerLevel(cid) == table.4 then
doBroadcastMessage("O jogador "..getPlayerName.." avançou para o level 400")
end
if getPlayerLevel(cid) == table.5 then
doBroadcastMessage("O jogador "..getPlayerName.." avançou para o level 500")
end
if getPlayerLevel(cid) == table.6 then
doBroadcastMessage("O jogador "..getPlayerName.." avançou para o level 600")
end
return true
end
Broadcast Atingir Level x
Por regisfferzola, 02 de abr. de 2013 em Scripts
info
Grupo: Banidos
Registrado: 11/01/13
Posts: 576
Reputação: +109
Char no Tibia: Darashia del Shee

info
Grupo: Campones
Registrado: 05/11/12
Posts: 22
Reputação: 0

Deu erro...
[Erro - CreatureEvent::configureEvent] No valid type for creature event ![]()
info
Grupo: Banidos
Registrado: 11/01/13
Posts: 576
Reputação: +109
Char no Tibia: Darashia del Shee

Deu erro...
[Erro - CreatureEvent::configureEvent] No valid type for creature event
Me mostra como você botou a tag
info
Grupo: Campones
Registrado: 05/11/12
Posts: 22
Reputação: 0

<event type="advance" name="broadlvl" event="script" value="broadlvl.lua"/>
Aquele erro arrumei foi amadorismo meu... mas olha o erro que ta dando agora...
[Error - LuaInterface::loadFile] data/creaturescripts/scripts/broadlvl.lua:10: 'end' expected (to close 'funciton' at line9) near 'elseif
[Warring - Event::loadScript] Cannot load script (data/creaturescripts/scripts/broadlvl.lua:10: 'end' expected (to close 'function' at line 9) near 'elseif'
info
Grupo: Banidos
Registrado: 11/01/13
Posts: 576
Reputação: +109
Char no Tibia: Darashia del Shee

Testa assim .-.
local table = {
[1] = 100,
[2] = 200,
[3] = 300,
[4] = 400,
[5] = 500,
[6] = 600
}
function onAdvance(cid, oldLevel, newLevel)
if getPlayerLevel(cid) == table[1] then
return doBroadcastMessage("O jogador ["..getPlayerName.."] avançou para o level 100")
end
end
if getPlayerLevel(cid) == table[2] then
return doBroadcastMessage("O jogador ["..getPlayerName.."] avançou para o level 200")
end
if getPlayerLevel(cid) == table[3] then
doBroadcastMessage("O jogador ["..getPlayerName.."] avançou para o level 300")
end
if getPlayerLevel(cid) == table[4] then
doBroadcastMessage("O jogador ["..getPlayerName.."] avançou para o level 400")
end
if getPlayerLevel(cid) == table[5] then
doBroadcastMessage("O jogador ["..getPlayerName.."] avançou para o level 500")
end
if getPlayerLevel(cid) == table[6] then
doBroadcastMessage("O jogador ["..getPlayerName.."] avançou para o level 600")
end
return true
info
Grupo: Campones
Registrado: 05/11/12
Posts: 22
Reputação: 0

(InternalGetPlayerInfo) Player not found when requesting player info #3
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

Vá em data / creaturescripts / scripts / renome algum arquivo para broadlvl.lua
é cole isso dentro .
local levels = {
level1 = {100},
level2 = {200},
level3 = {300},
level4 = {400}
}
function onLogin(cid)
if getPlayerLevel(cid) == level1 then
doBroadcastMessage("O jogador "..getPlayerName(cid).." avançou para o level 100")
return true
elseif getPlayerLevel(cid) == level2 then
doBroadcastMessage("O jogador "..getPlayerName(cid).." avançou para o level 200")
return true
elseif getPlayerLevel(cid) == level3 then
doBroadcastMessage("O jogador "..getPlayerName(cid).." avançou para o level 300")
return true
elseif getPlayerLevel(cid) == level4 then
doBroadcastMessage("O jogador "..getPlayerName(cid).." avançou para o level 400")
end
return true
end
agora vá em data / creaturescripts / scripts / login.lua
Na ultima linha adicione .
registerCreatureEvent(cid, "BroadLvl")
agora em creaturescripts.xml
<event type="login" name="BroadLvl" event="script" value="broadlvl.lua"/>
info
Grupo: Campones
Registrado: 05/11/12
Posts: 22
Reputação: 0

Vou testar quando chegar em casa e dou um retorno... Muito Obrigado pela ajuda man ;D
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Nossa, quanta dificuldade .-.
broadcastlevel.lua:
function isInteger(n)
return math.floor(n) == n and true or false
end
function onAdvance(cid, skill, oldLevel, newLevel)
if isInteger(newLevel/100) then
broadcastMessage("O jogador "..getCreatureName(cid).." atingiu o level "..newLevel..".")
end
return true
end
login.lua (antes do último return true):
registerCreatureEvent(cid, "BroadcastLevel")
creaturescripts.xml:
<event type="advance" name="BroadcastLevel" script="broadcastlevel.lua"/>
info
Grupo: Campones
Registrado: 05/11/12
Posts: 22
Reputação: 0






info
Grupo: Campones
Registrado: 05/11/12
Posts: 22
Reputação: 0
Boa Tarde galera,
Gostaria de um script que funcionasse da seguinte maneira.
Ao definir ao atingir por exemplo level 100, 200, 300, 400 e assim por diante dar uma msg no broadcast para todos player... Player Tal atingiu level x.
Desde de já agradeço