Scorpvm 101
Active Member
Hi guys,
It's possible make one blessing book what have 5charge?
It's possible make one blessing book what have 5charge?
function onUse(cid, item, frompos, item2, topos)
local maxbless = 5 --think 5 is standard dunno just change to how much times the player is blessed per usage of the book
local bookcharges = 5 --change to how many times it can be used.
local t = string.explode(getItemSpecialDescription(item.uid), " ")
local charges = t[1]
for i = 1,maxbless do
if getPlayerBlessing(cid, i) then
if i == maxbless then
doPlayerSendCancel(cid, "You are already blessed!")
return false
end
else
doPlayerAddBlessing(cid, i)
if i == maxbless then
if charges > 1 then
charges = charges-1
else
doRemoveItem(item.uid,1)
end
doItemSetAttribute(item.uid, "description",charge.. " bless times left")
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been blessed!")
end
end
end
return true
end