• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Help with doPlayerAddManaSpent

Michael Orsino

Premium User
Premium User
Support Team
Joined
Nov 15, 2007
Messages
864
Solutions
10
Reaction score
451
Location
Western Australia
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.

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