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

<Request> Book of never lose aol or bless for time

Seumion

★ Spell Maker & Mapper ★
Joined
Feb 24, 2015
Messages
172
Reaction score
2
hello otland can you help me with that script.
Explain my request:i want when i click on BOOK i won't lose aol and give me forever bless for 30 days

note:i won't when i use the book it give me aol and bless nono i want when i use that book it will give me aol one time only if i don't have it if i have it it will save my aol to no lose it for 30 days and check if i don't have bless it will give me please and save it for 30 days
using tfs 0.4 dev

thanks

@imkingran
 
Last edited:
Code:
local autoBlessStorage = 57927
local autoAOLStorage = 57928

function onLogin(cid)
local templePosition = getTownTemplePosition(getPlayerTown(cid))
local playerPosition = getThingPosition(cid)
local fyi = {}
local msg = {}
if(getDistanceBetween(templePosition, playerPosition) <= 2) then
if(getCreatureStorage(cid, autoAOLStorage) == 1 and getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 0) then
if(doPlayerRemoveMoney(cid,10000)) then
doPlayerAddItem(cid,2173,1)
doCreatureSay(cid,'AOL',TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPosition(cid),CONST_ME_BATS)
table.insert(msg, 'You have bought Amulet of Loss!')
else
table.insert(fyi, 'You got no money for Amulet of Loss! It cost 1 crystal coin!')
end
end
if(getCreatureStorage(cid, autoBlessStorage) == 1 and not getPlayerBlessing(cid,1)) then
if(doPlayerRemoveMoney(cid,50000)) then
for b=1,5 do
doPlayerAddBlessing(cid,b)
end
doCreatureSay(cid,'BLESS',TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPosition(cid),CONST_ME_HOLYDAMAGE)
table.insert(msg, 'You have been blessed by the gods!')
else
table.insert(fyi, 'You got no money for Bless! It cost 5 crystal coin!')
end
end
end
if(#fyi > 0) then
doPlayerPopupFYI(cid, table.concat(fyi, '\n'))
end
if(#msg > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, table.concat(msg, '\n'))
end
if(#msg > 0 or #fyi > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You can turn off auto buyer by commands:\n!aol off\n!bless off')
end
return true
end
 
Code:
local autoBlessStorage = 57927
local autoAOLStorage = 57928

function onLogin(cid)
local templePosition = getTownTemplePosition(getPlayerTown(cid))
local playerPosition = getThingPosition(cid)
local fyi = {}
local msg = {}
if(getDistanceBetween(templePosition, playerPosition) <= 2) then
if(getCreatureStorage(cid, autoAOLStorage) == 1 and getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 0) then
if(doPlayerRemoveMoney(cid,10000)) then
doPlayerAddItem(cid,2173,1)
doCreatureSay(cid,'AOL',TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPosition(cid),CONST_ME_BATS)
table.insert(msg, 'You have bought Amulet of Loss!')
else
table.insert(fyi, 'You got no money for Amulet of Loss! It cost 1 crystal coin!')
end
end
if(getCreatureStorage(cid, autoBlessStorage) == 1 and not getPlayerBlessing(cid,1)) then
if(doPlayerRemoveMoney(cid,50000)) then
for b=1,5 do
doPlayerAddBlessing(cid,b)
end
doCreatureSay(cid,'BLESS',TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPosition(cid),CONST_ME_HOLYDAMAGE)
table.insert(msg, 'You have been blessed by the gods!')
else
table.insert(fyi, 'You got no money for Bless! It cost 5 crystal coin!')
end
end
end
if(#fyi > 0) then
doPlayerPopupFYI(cid, table.concat(fyi, '\n'))
end
if(#msg > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, table.concat(msg, '\n'))
end
if(#msg > 0 or #fyi > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You can turn off auto buyer by commands:\n!aol off\n!bless off')
end
return true
end
where i put it
 
Creaturescripts:-

registerCreatureEvent(cid, "autobuyer")

<event type="login" name="autobuyer" event="script" value="autobuyer.lua"/>
 
Back
Top