• 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] Forever aol and bless

Seumion

★ Spell Maker & Mapper ★
Joined
Feb 24, 2015
Messages
172
Reaction score
2
hello otlander and support can you give me script when i click on item i will get automatic aol and bless for 10 days and when chr log it says automatic aol and bless
Using Tfs 0.3.6 8.6
@heba @Limos
 
for auto buy aol and blees go creaturescript and add this
Code:
local autoBlessStorage = 57927
local autoAOLStorage = 57928

function onLogin(cid)
    local templePosition = getTownTemplePosition(getPlayerTown(cid))
    local playerPosition = getThingPosition(cid)
    local fyi = {}
    local msg = {}
        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
        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:
<event type="login" name="autobuyer" event="script" value="autobuyer.lua"/>
Code:
registerCreatureEvent(cid, "autobuyer")

for items player must use to get this u can use somthing like this

and action script

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 1 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 18224)
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13549) - os.time() <= 0 then
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13549, time)
setPlayerStorageValue(cid, 57928, daily+1)
local daily = getPlayerStorageValue(cid, 57928)
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You got 1 cc.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily quest. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end
Code:
<action itemid="xxxx" event="script" value="storge for time.lua"/>
i edite this when use get aol u add more storge for bless
local daysvalue = 1 * 24 * 60 * 60 = one day for 10 days
local daysvalue = 10 * 24 * 60 * 60
 
Like when they use a lever or a book etc.. whatever you put for the ID of "xxxx".. otherwise the first script (creaturescripts) will take 60k and give the player AOL & Bless
 
items player must use to get storge
can you fix it when i use the book i will get forever aol and bless for 30 days and when player open
the creature say automatic aol and bless _orange?
and i want this forever aol and bless for free not for money
 
omg its work like this if player use book will get auto aol and bless when die
for edite days edite this line
local daysvalue = 1 * 24 * 60 * 60 = one day
to make 30 days
local daysvalue = 30 * 24 * 60 * 60
and add id of book here
<action itemid="xxxx" event="script" value="storge for time.lua"/>

in xxxx = id of book
 
omg its work like this if player use book will get auto aol and bless when die
for edite days edite this line
local daysvalue = 1 * 24 * 60 * 60 = one day
to make 30 days
local daysvalue = 30 * 24 * 60 * 60
and add id of book here
<action itemid="xxxx" event="script" value="storge for time.lua"/>

in xxxx = id of book
bro i know what u mean but i mena other thing
don't need when he open he got aol and bless nono i want it forever for 30 days then befor he log he will got thw twice
 
easy u can use items like life ring and edite time for 30days and make foreveraol and bless on amulte so if he used amulte 30days will remove like life ring other idea u can make like
use function onPrepareDeath
if isPlayer(cid) == true then
if getPlayerStorageValue(cid, storage) == 1
doCreatureSetDropLoot(cid, false)
there alot idea to make somthing like this try with urself :D
 
u can use somthing like this
Code:
local bless = {1, 2, 3, 4, 5}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if getPlayerStorageValue(cid, 57928) == 1 then
doCreatureSetDropLoot(cid, false)
for i = 1, table.maxn(bless) do
doPlayerAddBlessing(cid, bless[i])
end
end
return true
end
Code:
<event type="preparedeath" name="forever amulet" event="script" value="forever amulet.lua"/>
Code:
registerCreatureEvent(cid, "forever amulet")
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 30 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 18224)
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13549) - os.time() <= 0 then
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13549, time)
setPlayerStorageValue(cid, 57928, daily+1)
local daily = getPlayerStorageValue(cid, 57928)
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You will get blessing and forvere amulte for 30 days.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 30 days to use it again. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end
Code:
<action itemid="xxxx" event="script" value="storge for time.lua"/>
change xxx for id of book notic this script don't test if there any erorr tell me don't forget when u add it restart ur oto
 
when i use the book i don't got anything

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 30 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 18224)
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13549) - os.time() <= 0 then
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13549, time)
setPlayerStorageValue(cid, 57928, daily+1)
local daily = getPlayerStorageValue(cid, 57928)
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You will get blessing and forvere amulte for 30 days.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 30 days to use it again. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end
Code:
<action itemid="xxxx" event="script" value="storge for time.lua"/>
change xxx for id of book notic this script don't test if there any erorr tell me don't forget when u add it restart ur oto
[16/03/2015 14:17:07] [Error - Action Interface]
[16/03/2015 14:17:07] data/actions/scripts/other/storge for time.lua:onUse
[16/03/2015 14:17:07] Description:
[16/03/2015 14:17:07] data/actions/scripts/other/storge for time.lua:15: attempt to concatenate a nil value
[16/03/2015 14:17:07] stack traceback:
[16/03/2015 14:17:07] data/actions/scripts/other/storge for time.lua:15: in function <data/actions/scripts/other/storge for time.lua:1>
 
Last edited by a moderator:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 1 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 57928)
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13540, time)
setPlayerStorageValue(cid, 57928, daily+1)
local daily = getPlayerStorageValue(cid, 57928)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You got 1 cc.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily quest. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end
 
now its work 100% when u use book will get storge to auto buy aol and blessing for 30 days when player die will auto buy blessing and aol right lets install it
first go to action/scripts put this lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 30 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 13541)
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13540, time)
setPlayerStorageValue(cid, 13541, daily+1)
local daily = getPlayerStorageValue(cid, 13541)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You got 1 cc.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily quest. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end
and in action.xml
Code:
<action itemid="xxxx" event="script" value="storge for time.lua"/>

change id of book "xxxx"

now creaturescript
Code:
local autoBlessStorage = 13541
local autoAOLStorage = 13541

function onLogin(cid)
    local templePosition = getTownTemplePosition(getPlayerTown(cid))
    local playerPosition = getThingPosition(cid)
    local fyi = {}
    local msg = {}
        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
        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
creaturescript.xml
Code:
<event type="login" name="autobuyer" event="script" value="autobuyer.lua"/>

in login
Code:
registerCreatureEvent(cid, "autobuyer")

100% work this when player die auto buy aol and blessing and if he don't ave money will get fly say u don't have money to buy X1 aol X2 blessing
Rep me if i helped you

and for tile lvl go to movement add this
Code:
local tpto = {x = 1072, y = 992, z = 11} -- where tp take you 
local level = 500
function onStepIn(cid, item, position, fromPosition)
    if not(isPlayer(cid)) then return true end
    if getPlayerLevel(cid) >= level then
        doTeleportThing(cid, tpto)
        doSendMagicEffect(tpto,10)
    else
        doPlayerSendTextMessage(cid,22, "Sorry, but you need to be level "..level.."+ to enter here")
        doSendMagicEffect(getThingPos(cid),10)
        doTeleportThing(cid, fromPosition)
        end
    return true
end
and in movement.xml
Code:
<movevent type="StepIn" actionid="44410" event="script" value="dptp.lua"/>
 
Back
Top