Trying to make a script where when a player uses a certain book, they are given 'magical knowledge'
Does not seem to give the manaspent when using, and the storage values are not working.
Does not seem to give the manaspent when using, and the storage values are not working.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
Storage = getPlayerStorageValue(cid,12443)
if Storage == -1 then
doCreatureSay(cid, "You gained magical knowledge", TALKTYPE_ORANGE_1)
doPlayerAddManaSpent(cid, 50000)
doSendMagicEffect(fromPosition, 12)
setPlayerStorageValue(cid,12443,1)
else
doCreatureSay(cid, "You have already read this book", TALKTYPE_ORANGE_1)
end
end
return 1
end