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

Can anyone improve this Scripts? REP++

Piltrafa

Active Member
Joined
Nov 10, 2010
Messages
654
Reaction score
29
Hello, I want to make exahusted on this Scripts, because maybe OT will be crash if spam.

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)
doWriteLogFile("data/logs/bless.txt", "".. getCreatureName(cid) ..": !bless [already have]")
else
if doPlayerRemoveMoney(cid, 100000) == TRUE then
for i = 1,5 do
doPlayerAddBlessing(cid,i)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings for 100k!")
doWriteLogFile("data/logs/bless.txt", "".. getCreatureName(cid) ..": !bless [bless added]")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 100,000 gp in backpack for blessings.")
doWriteLogFile("data/logs/bless.txt", "".. getCreatureName(cid) ..": !bless [not enough money]")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ICEAREA)
end

end
return TRUE
end

I think, exahusted of 20-30 seconds its perfect, but i didn't know how to make it.
Help me, I repped you.
 
I have tested it and dind't work... :S

1. Its didn't save on Logs.
2. its didn't get mort area or somethings.
3. Its says all the time thats you say !bless:

03:51 You have already been blessed.
03:51 You have already been blessed.
03:51 You have already been blessed.
03:51 You have already been blessed.
03:51 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.
03:52 You have already been blessed.

Fix it please, I need that.
Thanks, I hope anyone can help me.
 
3. Its says all the time thats you say !bless:
That's because you are using the command with a GM :D Test with a normal player.
Now, last script was buggy but this one will work:
LUA:
local exhaustStorage = 10113
local price, seconds = 100000, 30
 
function onSay(cid, words, param, channel)
    if exhaustion.check(cid, exhaustStorage) then
        doPlayerSendCancel(cid, 'You can\'t use this command yet['..exhaustion.get(cid, exhaustStorage)..'].')
        return true
    else
        exhaustion.set(cid, exhaustStorage, seconds)
    end
 
    if getPlayerBlessing(cid, 5) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have already been blessed.')
        doSendMagicEffect(getThingPos(cid), CONST_ME_MORTAREA)
        doWriteLogFile('data/logs/bless.txt', getCreatureName(cid) ..': !bless [already have]')
        return true
    end
    
    if doPlayerRemoveMoney(cid, price) then
        for i = 1, 5 do
            doPlayerAddBlessing(cid,i)
        end
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have received blessings for 100k!')
        doWriteLogFile('data/logs/bless.txt', getCreatureName(cid) ..': !bless [bless added]')
        doSendMagicEffect(getThingPos(cid), CONST_ME_ENERGYAREA)
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You need 100,000 gp in backpack for blessings.')
        doWriteLogFile('data/logs/bless.txt', getCreatureName(cid) ..': !bless [not enough money]')
        doSendMagicEffect(getThingPos(cid), CONST_ME_ICEAREA)
    end
    return true
end
 
Oh well, Works fine.
Thanks you.

Can you make same Script, but thats buy Aol? (And If you got an Aol in your Characters says: !aol [already have])
 
LUA:
function onSay(cid, words, param, channel)
if (getPlayerItemCount(cid, 2160) * 10000 + getPlayerItemCount(cid, 2152) * 100 + getPlayerItemCount(cid, 2148)) >= 15000 then
    if getPlayerItemCount(cid, 2173) < 1 then
        doPlayerSendTextMessage(cid,22,"Amulet of loss added to your inventory.")
        doPlayerRemoveMoney(cid, 15000)
        doPlayerAddItem(cid, 2173, 1)
    else
    doPlayerSendTextMessage(cid,22,"You already have an aol!")
    end
else
doPlayerSendTextMessage(cid,22,"You don't have enough money.")
end
return 1
end
 
Back
Top