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

Lua storages

Cloow

Active Member
Joined
May 10, 2010
Messages
1,086
Reaction score
35
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	setPlayerStorageValue(cid, 15558, 1)
	  doCreatureSay(cid, "You have awokened the exiled dragon and thus he challenges you to enter his tomb.", 34) if
         getPlayerStorageValue(cid, 15558) == 1 then
			doPlayerSendCancel(cid, "You have already awokened the exiled dragon.")
	end	
return TRUE
end

This script wont read these lines
Code:
         getPlayerStorageValue(cid, 15558) == 1 then
			doPlayerSendCancel(cid, "You have already awokened the exiled dragon.")
instead it repeats this
Code:
	setPlayerStorageValue(cid, 15558, 1)
	  doCreatureSay(cid, "You have awokened the exiled dragon and thus he challenges you to enter his tomb.", 34)

I can't see what I did wrong?

Please help rep+
 
Try this:
Lua:
config =
{
	storageId = 15558
}

function onUse(cid, item, fromPos, itemEx, toPos)
	if (getPlayerStorageValue(cid, config.storageId) == -1) then
		doCreatureSay(cid, "You have awokened the exiled dragon and thus he challenges you to enter his tomb.", 34)
		setPlayerStorageValue(cid, config.storageId, 1)
	else
		doPlayerSendCancel(cid, "You have already awokened the exiled dragon.")
	end
	return true
end
 
Back
Top