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
<event type="login" name="autobuyer" event="script" value="autobuyer.lua"/>
registerCreatureEvent(cid, "autobuyer")
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
<action itemid="xxxx" event="script" value="storge for time.lua"/>
can you fix it when i use the book i will get forever aol and bless for 30 days and when player openitems player must use to get storge
bro i know what u mean but i mena other thingomg 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
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
<event type="preparedeath" name="forever amulet" event="script" value="forever amulet.lua"/>
registerCreatureEvent(cid, "forever amulet")
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
<action itemid="xxxx" event="script" value="storge for time.lua"/>
[16/03/2015 14:17:07] [Error - Action Interface]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 endchange 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 otoCode:<action itemid="xxxx" event="script" value="storge for time.lua"/>
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
if u can give me script when i go on tile it says only player level 50k can pass heregive me 5 min open server and test it
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
<action itemid="xxxx" event="script" value="storge for time.lua"/>
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
<event type="login" name="autobuyer" event="script" value="autobuyer.lua"/>
registerCreatureEvent(cid, "autobuyer")
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
<movevent type="StepIn" actionid="44410" event="script" value="dptp.lua"/>