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

[REQUEST] Cool down for aol and bless!

Ranyo13

ManCausingMayhem
Joined
Aug 22, 2009
Messages
981
Reaction score
39
Hello otlanders,
Im requesting a cool down system for bless command and aol command, here are my scripts i hope someone cud edit them so they have cool down of 60 seconds, and when a play tries to spam it he gets a message as a cancel message or red message in chat box that says "Cool down, (getsSecondsLeft) seconds left!" i want it to work even if the player buys any of them then die, i want it to work after the player dies also like cool down doesnt cancel if he buys aol then dies then buys aol again when he/she respawns.
Aol script:
PHP:
local buyableItems = 
{
	["aol"] = {money=10, id=2173, amount=1}
}
 
function onSay(cid, words, param)
	local text = "Here's a list of all items that you can buy\nShop Item Name - Price - Item Name - Amount\n\n"
	if(param == "" or param == nil) then
		for k, v in pairs(buyableItems) do
			text = text .. k .. " - " .. v.money .. " - " .. getItemNameById(v.id) .. " - " .. v.amount .. "\n"
		end
		return doShowTextDialog(cid, 1967, text)
	else
		buyItem = buyableItems[param]
		if buyItem then
       			if getPlayerMoney(cid) >= buyItem.money then
				doSendMagicEffect(getCreaturePosition(cid), 14)
				doPlayerAddItem(cid, buyItem.id, buyItem.amount)
            			doPlayerRemoveMoney(cid, buyItem.money)
            			doPlayerSendTextMessage(cid, 24, "You've succesfully bought " .. param .. "!")
				return true
        		else
            			return doPlayerSendCancel(cid, "You need " .. buyItem.money .. " gold coins to buy this item.")
        		end
    		else
        		return doPlayerSendCancel(cid, "Wrong param for buyable items.")
		end
    	end
	return true
end
Bless script:
PHP:
function onSay(cid, words, param)
 
	if getPlayerBlessing(cid,5) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
	else
		if doPlayerRemoveMoney(cid, 1000) == TRUE then
			for i = 1,5 do
				doPlayerAddBlessing(cid,i)
			end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings!")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 10 scarab coins for blessings.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ICEAREA)
		end
	end
	return TRUE
end

If you edit them the cool down system, please highlight what you added coz im 100% sure that i will need the system in more commands later.
Please help me with that and i will realy appreciate it and i will add reputation to you (Rep++) :p
Thanks in advance,
Ranyo13
 
Dude stop trolling arround just stop posting useless shit on my thread and get ur f**kin ass off here.. I can see u got nothing to do.. Just trolling on others threads.
IF i wud make it by MYSELF why wud otland put a request tab?
 
Dude stop trolling arround just stop posting useless shit on my thread and get ur f**kin ass off here.. I can see u got nothing to do.. Just trolling on others threads.
IF i wud make it by MYSELF why wud otland put a request tab?
We've given you plenty of tips, obviously ur just going to make money off of other people's work.

EDIT: Feeling nice because of 1234 posts so, i've fixed one of the scripts, try it out.

LUA:
local buyableItems =  
{ 
    ["aol"] = {money=10, id=2173, amount=1} 
} 
  
function onSay(cid, words, param) 
    local text = "Here's a list of all items that you can buy\nShop Item Name - Price - Item Name - Amount\n\n"
if getPlayerStorage(cid, 1338) then
		doPlayerSendCancel(cid, "You've already bought an aol this life")
		doPlayerSendEffect(getCreaturePosition(cid), CONST_ME_POOF)
else
    if(param == "" or param == nil) then 
        for k, v in pairs(buyableItems) do 
            text = text .. k .. " - " .. v.money .. " - " .. getItemNameById(v.id) .. " - " .. v.amount .. "\n" 
        end 
        return doShowTextDialog(cid, 1967, text) 
    else 
        buyItem = buyableItems[param] 
        if buyItem then 
                   if getPlayerMoney(cid) >= buyItem.money then
				doPlayerSetStorageValue(cid, storage, 1338)
                doSendMagicEffect(getCreaturePosition(cid), 14) 
                doPlayerAddItem(cid, buyItem.id, buyItem.amount) 
                        doPlayerRemoveMoney(cid, buyItem.money) 
                        doPlayerSendTextMessage(cid, 24, "You've succesfully bought " .. param .. "!") 
                return true 
                else 
                        return doPlayerSendCancel(cid, "You need " .. buyItem.money .. " gold coins to buy this item.") 
                end 
            else 
                return doPlayerSendCancel(cid, "Wrong param for buyable items.") 
        end 
        end 
    return true 
end
end
Add to creaturescripts:
LUA:
function onDeath(cid)
	if getPlayerStorage(cid, 1338) then
		doPlayerSetStorageValue(cid, storage, -1)
		return true
	end
end
That's the AOL script.
 
Last edited by a moderator:
Code:
local function hasBless(cid)
	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			return true
		end
	end
	return false
end

function onSay(cid, words, param, channel)
	if hasBless(cid) then
		return doPlayerSendCancel(cid, 'You have been blessed already.')
	end

	if exhaustion.get(cid, 1234) then
		return doPlayerSendCancel(cid, 'You are exhausted.')
	end

	if doPlayerRemoveMoney(cid, 1000) then
		for i = 1, 5 do
			doPlayerAddBlessing(cid, i)
		end
		exhaustion.set(cid, 1234, 60) -- 60 sec, change to w/e
		doPlayerSendCancel(cid, 'You have received blessings!')
		doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
	else
		doPlayerSendCancel(cid, 'You do not have enough money.')
		doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
	end
	return true
end

Happy 'nuff? :/
 
Dude, i said in red :o and in the chat box, plus it already says You are already blessed. And people cud spam it and lag my ot.
 
Dude, i said in red :o and in the chat box, plus it already says You are already blessed. And people cud spam it and lag my ot.
Well then switch it to "doPlayerSendCancel" what's so hard about editing a bit urself? Also you could try saying what didn't work with my script?
 
Well i had some items with the aol, so when someone tries to spam like !buy food it will answer back u got an aol for the life or w/e
 
Back
Top