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

RevScripts Script promotion for guild

Joker Man

Active Member
Joined
Nov 7, 2021
Messages
106
Reaction score
27
Some one help me? hard script
i add promotion 1 time if you dead lose it
but i need Stone when leader guild click give all promotion
how i do that
function onUse(cid, item, frompos, item2, topos)

if getPlayerVocation(cid) == 5 and getPlayerItemCount(cid,2348) >= 1 then
doPlayerSetVocation(cid, 9)
doSendAnimatedText(getPlayerPosition(cid), "Promotion", TEXTCOLOR_RED)
elseif getPlayerVocation(cid) == 6 and getPlayerItemCount(cid,2348) >= 1 then
doPlayerSetVocation(cid, 10)
doSendAnimatedText(getPlayerPosition(cid), "Promotion", TEXTCOLOR_RED)
elseif getPlayerVocation(cid) == 7 and getPlayerItemCount(cid,2348) >= 1 then
doPlayerSetVocation(cid, 11)
doSendAnimatedText(getPlayerPosition(cid), "Promotion", TEXTCOLOR_RED)
elseif getPlayerVocation(cid) == 8 and getPlayerItemCount(cid,2348) >= 1 then
doPlayerSetVocation(cid, 12)
doSendAnimatedText(getPlayerPosition(cid), "Promotion", TEXTCOLOR_RED)
else
end
end
 
Lua:
local requireItemId = 2348
local exhaustTime = 3 -- # seconds
local exhaustPlayer = {}

function onUse(cid, item, frompos, item2, topos)

    local cooldownSeconds = (exhaustPlayer[cid] or 0)
    if cooldownSeconds > os.time() then
        return doPlayerSendCancel(cid, "Please wait " .. (cooldownSeconds - os.time()) .. " seconds to use the item again.")
    end

    if getPlayerItemCount(cid, requireItemId) < 1 then
        -- # local article = getItemInfo(requireItemId).article
        -- # return doPlayerSendCancel(cid, "You need " .. (article ~= "" and article .." " or "") .. getItemNameById(requireItemId) .. ".")
        return false
    end

    local players = {}
    players[1] = cid

    if getPlayerGuildLevel(cid) == GUILD_LEADER then
        local getPlayerGuildId = getPlayerGuildId

        for i, pid in ipairs(getPlayersOnline()) do
            if cid ~= pid and getPlayerGuildId(cid) == getPlayerGuildId(pid) then
                players[#players + 1] = pid
            end
        end
    end

    local promotedPlayers = 0
    for i = 1, #players do

        local pid = players[i]
        local vocId = getPlayerVocation(pid)

        if vocId > 4 and vocId <= 8 then
            doPlayerSetVocation(pid, getPlayerVocation(pid) + 4)
            doSendAnimatedText(getPlayerPosition(pid), "Promotion", TEXTCOLOR_RED)

            promotedPlayers = promotedPlayers + 1
        end
    end

    exhaustPlayer[cid] = os.time() + exhaustTime
    if promotedPlayers == 0 then
        return doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
    end
  
    -- # doPlayerRemoveItem(cid, requireItemId, 1)
    doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
    return true
end
 
this is working
But have bug, every time leader logout can change voc all team to elder druid/to hack druid/ if leader logout and use stone agine get all none voc
 
I don`t need To Remove Stone after use
the stone is donate for leader Guild Give all promotion any one logout lose it
can leader use stone give promotion agine
Have fun
 
Back
Top