Witam!
Mam problem z itemkiem, który po użyciu daje nam 15% do max many na cza 15 minut a kolejne jego użycie jest możliwe po kolejnych 15 minutach.
Skrypt:
I po wielu przeróbkach nadal takie błędy w konsoli:
TFS 0.3.6
Proszę o pomoc. Będe wdzięczny.
Mam problem z itemkiem, który po użyciu daje nam 15% do max many na cza 15 minut a kolejne jego użycie jest możliwe po kolejnych 15 minutach.
Skrypt:
Code:
function onUse(cid, item)
if isPlayer(cid) then
local time = 900 -- time in seconds
local storage = 9393 -- Must be unused!
local manaPercent = 15 --- How many % MP add!
local name = getPlayerName(cid)
if(not checkExhausted(cid, 132, time+2)) then
return true
end
local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAXMANAPERCENT, 100 + manaPercent)
setConditionParam(condition1, CONDITION_PARAM_TICKS, -1)
if (getPlayerStorageValue(cid, storage) <= os.time()) then
doAddCondition(cid, condition1)
doCreatureSay(cid, "Yeeeah!!!\nFeel the power!", 19)
doSendMagicEffect(getCreaturePosition(cid), 133)
doRemoveItem(item.uid, 0)
addEvent(function()
if isPlayer(cid) then
doPlayerSendTextMessage(cid, 23, "Super system is time out!")
doRemoveCondition(cid, CONDITION_ATTRIBUTES)
end
return true
end, time*1000+40, cid)
else
doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.")
end
return TRUE
end
end
I po wielu przeróbkach nadal takie błędy w konsoli:
Code:
[13/04/2013 11:43:35] [Error - Action Interface]
[13/04/2013 11:43:35] data/actions/scripts/bonuski.lua:onUse
[13/04/2013 11:43:35] Description:
[13/04/2013 11:43:35] (luaCreateConditionObject) This function can only be used while loading the script.
[13/04/2013 11:43:35] [Error - Action Interface]
[13/04/2013 11:43:35] data/actions/scripts/bonuski.lua:onUse
[13/04/2013 11:43:35] Description:
[13/04/2013 11:43:35] (luaSetConditionParam) This function can only be used while loading the script.
[13/04/2013 11:43:35] [Error - Action Interface]
[13/04/2013 11:43:35] data/actions/scripts/bonuski.lua:onUse
[13/04/2013 11:43:35] Description:
[13/04/2013 11:43:35] (luaSetConditionParam) This function can only be used while loading the script.
[13/04/2013 11:43:35] [Error - Action Interface]
[13/04/2013 11:43:35] data/actions/scripts/bonuski.lua:onUse
[13/04/2013 11:43:35] Description:
[13/04/2013 11:43:35] (luaSetConditionParam) This function can only be used while loading the script.
[13/04/2013 11:43:35] [Error - Action Interface]
[13/04/2013 11:43:35] data/actions/scripts/bonuski.lua:onUse
[13/04/2013 11:43:35] Description:
[13/04/2013 11:43:35] (luaDoAddCondition) Condition not found
TFS 0.3.6
Proszę o pomoc. Będe wdzięczny.