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

Action script not working

Ecstacy

Mothafuckaaa
Joined
Dec 26, 2008
Messages
3,836
Reaction score
108
Location
The Netherlands
Hey,

This action is not working and I have no idea why.

LUA:
local item,storage,message,mana,level,cancelmsg = 7440,71150,'Your mana have been boosted by 300.000 mana!',300000,50000,'You can not use this!'

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (item.itemid == item) then
		if getPlayerStorageValue(cid, storage) < 1 then
			if getPlayerLevel(cid) >= level then
				doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,message)
				setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+mana))
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
				doRemoveItem(item.uid)
			else
				doPlayerSendCancel(cid,cancelmsg)
			end
			return TRUE
		else
			doPlayerSendCancel(cid,cancelmsg)
		end
	end
end

when I use it I get no error, nor it works when I use it.
 
PHP:
local item,storage,message,mana,level,cancelmsg = 7440,71150,'Your mana have been boosted by 300.000 mana!',300000,50000,'You can not use this!'

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if (item.itemid == item) then
                if getPlayerStorageValue(cid, storage) < 1 then
                        if getPlayerLevel(cid) >= level then
                                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,message)
                                setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+mana))
                                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                                doRemoveItem(item.uid)
                        else
                                doPlayerSendCancel(cid,cancelmsg)
                        end
                        return TRUE
                else
                        doPlayerSendCancel(cid,cancelmsg)
                        return false
                end
        end

end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 71150) < 1 and getPlayerLevel(cid) >= 50000 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Your mana has been boosted by 30.0000 mana!')
		setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300000)
		doCreatureAddMana(cid, 300000)
		doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
		return doRemoveItem(item.uid)
	end
	return doPlayerSendCancel(cid, 'You can not use this!')
end
 
Back
Top