• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem z itemem dodającym % do max many (kolejne użycie po x czasie)

Zielas92

New Member
Joined
Oct 24, 2010
Messages
17
Reaction score
0
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:

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.
 
Back
Top