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

Lua Transform scripts to revscriptsys

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
201
Reaction score
15
Hi someone help me to transform this script to revscriptsys, I tried but it gives me these errors in my console, this is the original script

Lua:
function onSay(cid, words, param)
    local playerGuild = getPlayerGuildId(cid)
    if playerGuild > 0 then
        local playerGuildLevel = getPlayerGuildLevel(cid)
        if playerGuildLevel >= GUILDLEVEL_VICE then
            local players = getOnlinePlayers()
            local message = "*Guild* " .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]:\n" .. param;
            for i,playerName in ipairs(players) do
                local player = getPlayerByName(playerName);
                if getPlayerGuildId(player) == playerGuild then
                    doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, message);
                end
            end
            doPlayerSendCancel(cid, "Message sent to whole guild.");
        else
            doPlayerSendCancel(cid, "You have to be at least Vice-Leader to guildcast!");
        end
    else
        doPlayerSendCancel(cid, "Sorry, you're not in a guild.");
    end
    doPlayerSendTextMessage(cid, 25, words)
    return FALSE
end

This is the one I tried to do but it gives me these errors

Code:
local guildCommand = TalkAction("!guild")

function guildCommand.onSay(cid, words, param)
    local playerGuild = getPlayerGuildId(cid)
    if playerGuild > 0 then
        local playerGuildLevel = getPlayerGuildLevel(cid)
        if playerGuildLevel >= GUILDLEVEL_VICE then
            local players = getOnlinePlayers()
            local message = "*Guild* " .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]:\n" .. param;
            for i,playerName in ipairs(players) do
                local player = getPlayerByName(playerName);
                if getPlayerGuildId(player) == playerGuild then
                    doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, message);
                end
            end
            doPlayerSendCancel(cid, "Message sent to whole guild.");
        else
            doPlayerSendCancel(cid, "You have to be at least Vice-Leader to guildcast!");
        end
    else
        doPlayerSendCancel(cid, "Sorry, you're not in a guild.");
    end
    doPlayerSendTextMessage(cid, 25, words)
    return FALSE
end

guildCommand:separator(" ")
guildCommand:register()


error
Code:
Lua Script Error: [Scripts Interface]
/home/forgottenserver/data/scripts/talkactions/player/guild_cast.lua:callback
...tenserver/data/scripts/talkactions/player/guild_cast.lua:5: attempt to compare number with boolean
stack traceback:
        [C]: in function '__lt'
        ...tenserver/data/scripts/talkactions/player/guild_cast.lua:5: in function <...tenserver/data/scripts/talkactions/player/guild_cast.lua:3>
 
Back
Top