Well, with Nahruto help we create a rooksystem, the script is fine but it was an error, we dont know what is the error so i post it
Code:
local config =
{
levelToRook = 5,
rookTempleId = 1,
health = 185,
mana = 0,
level = 1,
minutes = 56,
vocation = 0
}
function onDeath(cid, corpse, killer)
if (getPlayerLevel(cid) - 1) <= config.levelToRook and getPlayerVocation(cid) ~= 0 then
--Remueve los items.
for items = 1, 10 do
local slotItem = getPlayerSlotItem(cid, items)
if slotItem.itemid ~= 0 then
doRemoveItem(slotItem.uid)
end
end
--Actualiza los skills
for SkillID = 1, 7 do
db.executeQuery("UPDATE `player_skills` SET `value` = '10', `count` = '0' WHERE `player_skills`.`player_id` = '" .. getPlayerGUID(cid) .. "' AND `player_skills`.`skillid` = ".. SkillID .." LIMIT 1;")
end
db.executeQuery("UPDATE `players` SET `level` = '1' WHERE `id` = '" .. getPlayerGUID(cid) .. "' LIMIT 1;")
db.executeQuery("UPDATE `players` SET `maglevel` = '0' WHERE `id` = '" .. getPlayerGUID(cid) .. "' LIMIT 1;")
doPlayerSetTown(cid, config.rookTempleId)
doPlayerSetVocation(cid, config.vocation)
setCreatureMaxHealth(cid, config.health)
setCreatureMaxMana(cid, config.mana)
setCreatureHealth(cid, config.health)
setCreatureMana(cid, config.mana)
setPlayerStamina(cid, config.minutes)
doPlayerAddItem(cid, 1987, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been Rooked.")
end
return TRUE
end