ryandometal
Guitarist!
What is wrong with this script? Please HELP me!!!
I want to, if the player is level < 80, he got cursed condition, that hits -100 hp in 30 turns, but I got some errors.
Using TFS 0.2.7.
rep++
Lua:
local EXP = 1500000
local MESSAGE = "You earned 1.500.000 experience points for learning black africans."
local CANCEL = "DON'T OPEN THIS BOOK WITHOUT A GOOD EXPERIENCE, LITTLE MORTAL! GET THIS CURSE FOR YOU!"
local LEARNED = "You've already learned everything that was written in this book."
local STORAGE = 26666
function onUse(cid, item, frompos, item2, topos)
if (getPlayerStorageValue(cid, 4322) <= 0) then
doPlayerSendCancel(cid, "Sorry, you can not open this book.")
elseif (getPlayerStorageValue(cid, 4322) >= 2) and (getPlayerStorageValue(cid, STORAGE) <= 0) and getPlayerLevel(cid) >= 80 then
doPlayerAddExp(cid, EXP)
doCreatureSay(cid, MESSAGE, TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MORTAREA)
setPlayerStorageValue(cid, STORAGE, 1)
doRemoveItem(item.uid, 1)
elseif (getPlayerStorageValue(cid, STORAGE) >= 1) then
doCreatureSay(cid, LEARNED, TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
elseif getPlayerLevel(cid) < 80 then
local condition = createConditionObject(CONDITION_CURSED)
doCreatureSay(cid, CANCEL, TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MORTAREA)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 10, 3600, -100)
setCombatCondition(combat, condition)
end
return TRUE
end
PHP:
[22/02/2010 21:00:57] Lua Script Error: [Action Interface]
[22/02/2010 21:00:57] data/actions/scripts/quests/magician_book.lua:onUse
[22/02/2010 21:00:57] luaSetCombatCondition(). This function can only be used while loading the script.
I want to, if the player is level < 80, he got cursed condition, that hits -100 hp in 30 turns, but I got some errors.
Using TFS 0.2.7.
rep++