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

GlobalEvent Effect for tutors!

yeye Ineed it Too IF u can Make it for The highest Guild in the Frags It will be Cool :D
(For just the FIrst Guild!)
 
you can edit it if you want, i just saw it in highexp so i thought it would be nice if i share it with everyone, i'm not sure if it will work i didn't have time to test it so, just post errors if there are any !

Lua:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerGroupId(cid) ==3 then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "HELPER", TEXTCOLOR_RED)
               end
         end
         return true
end

please go easy on me I'm still a beginner I'm just trying to be helpful here, also to examine myself in what i've learned/read

This uses a lot of resources, good idea btw, but I would change to events/scripts/player.lua in order to iterate, without getting the list of online players.
 
And what should I wrote down in Globalevents note?, I copied this Code to Lua note and how to make it worked?
 
MbHRbs3.png


its a very funny scripts thanks for release guys !
 
for TFS 1.x

Lua:
function onThink(interval)
    players = Game.getPlayers()
        for i, v in ipairs(players) do
            player = Player(players[i])
                if player:getAccess() >= 3 then
                    player:say("Staff", TALKTYPE_MONSTER_SAY, 0, 1, player:getPosition())
                    player:getPosition():sendMagicEffect(10)
                end
        end
return true
end
 
for TFS 1.x

Lua:
function onThink(interval)
    players = Game.getPlayers()
        for i, v in ipairs(players) do
            player = Player(players[i])
                if player:getAccess() >= 3 then
                    player:say("Staff", TALKTYPE_MONSTER_SAY, 0, 1, player:getPosition())
                    player:getPosition():sendMagicEffect(10)
                end
        end
return true
end
Lua:
local cfg = {
    [1] = {"Tutor", CONST_ME_MAGIC_RED},
    [2] = {"Gamemaster", CONST_ME_MAGIC_BLUE},
    [3] = {"Admin", CONST_ME_MAGIC_GREEN}
}

function onThink(interval)
    local players = Game.getPlayers()
    for _, player in ipairs(players) do
        local effect = cfg[player:getGroup():getAccess()]
        if effect then
            player:say(effect[1], TALKTYPE_MONSTER_SAY)
            player:getPosition():sendMagicEffect(effect[2])
        end
    end
    return true
end
 
Lua:
local fag = {
[1] = {name = "Static_", age = 10, life_status = "Bitch Boy"}
}

Jk, I haven't done any coding in a long time didn't think of the most efficient way to do it. Thanks for correcting it.
 
Lua:
local fag = {
[1] = {name = "Static_", age = 10, life_status = "Bitch Boy"}
}

Jk, I haven't done any coding in a long time didn't think of the most efficient way to do it. Thanks for correcting it.
ok
 
Lua:
function onThink(interval, lastExecution)
    for k, v in pairs(getPlayersOnline()) do
        if getPlayerGroupId(v) == 3 and not isPlayerGhost(v) then
            if getPlayerStorageValue(v, 15612) == 1 then
                doSendMagicEffect(getPlayerPosition(v), CONST_ME_GIFT_WRAPS)
                doSendAnimatedText(getPlayerPosition(v), "Tutor", TEXTCOLOR_RED)
            end
        end
    end
    return true
end

Lua:
function onSay(cid, words, param, channel)
    if getPlayerAccess(cid) > 3 then
        if getPlayerStorageValue(cid, 15612) == 1 then
            setPlayerStorageValue(cid, 15612, 0)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Automatic Message: OFF")
        else
            setPlayerStorageValue(cid, 15612, 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Automatic Message: ON")
        end
    end
return true
end
 
Also made it so you can make a talkaction to turn it on and off.
 
Back
Top