• 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!

(help) with script generation

smockxd

New Member
Joined
Jan 18, 2012
Messages
13
Reaction score
0
I get this error in console when you use the item

HTML:
[25/03/2012 04:58:24] [Error - Action Interface] 
[25/03/2012 04:58:24] data/actions/scripts/senzu.lua:onUse
[25/03/2012 04:58:24] Description: 
[25/03/2012 04:58:24] attempt to index a number value
[25/03/2012 04:58:24] stack traceback:
[25/03/2012 04:58:24] 	[C]: in function 'doSendMagicEffect'
[25/03/2012 04:58:24] 	data/actions/scripts/senzu.lua:23: in function <data/actions/scripts/senzu.lua:1>

and this is the script
HTML:
function onUse(cid, item, frompos, item2, topos)

	local level = getPlayerLevel(cid)
	local mlevel = getPlayerMagLevel(cid)
	
	local exhausted_seconds = 1
	local exhausted_storagevalue = 7480
	
	local mana_minimum = 50000
	local mana_maximum =50000

	local mana_add = math.random(mana_minimum, mana_maximum)
	
		
		if(item.type >= 1) then
			if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
				if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
					doPlayerAddMana(cid, mana_add)
                                        doPlayerAddHealth(cid, mana_add)
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
				else
				doSendMagicEffect(cid, CONST_ME_POFF)
				doPlayerSendCancel(cid, "You are exhausted.")
			end
		else
			if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
				doSendMagicEffect(cid, CONST_ME_POFF)
				doPlayerSendCancel(cid, "You are exhausted.")
			else
				if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
					doPlayerAddMana(cid, mana_add)
                                        doPlayerAddHealth(cid, mana_add*1.5)
doPlayerSay(cid,"I feel the best",1)
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
				else
					doSendMagicEffect(cid, CONST_ME_POFF)
					doPlayerSendCancel(cid, "You are exchausted.")
				end
			end
		end
						
	return 1
end

help plis do you rep+ ;)
 

Similar threads

Back
Top