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

TFS 1.X+ Send Text msg

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,200
Solutions
2
Reaction score
149
Help me to repair this script?
To sent msg to all spectators...
tfs 1.2


LUA:
local spec = getSpectators({x = 31809, y = 33077, z = 9}, 12, 12)
            if spec ~= nil then
             for _, s in pairs(spec) do
                 if isPlayer(s) then           
                    spec(s):sendChannelMessage("", string.format(STATUSDEFAULT.messages.channel_slower.msg, creature:getName()), STATUSDEFAULT.messages.channel_slower.type, STATUSDEFAULT.channelID)
                 end
             end
            end
 
Solution
LUA:
    local spec = Game.getSpectators(Position(31809, 33077, 9), false, true, 12, 12, 12, 12)
    if spec then
        for _, s in ipairs(spec) do
            if s:isPlayer() then         
                s:sendChannelMessage("", string.format(STATUSDEFAULT.messages.channel_slower.msg, creature:getName()), STATUSDEFAULT.messages.channel_slower.type, STATUSDEFAULT.channelID)
            end
        end
    end
LUA:
    local spec = Game.getSpectators(Position(31809, 33077, 9), false, true, 12, 12, 12, 12)
    if spec then
        for _, s in ipairs(spec) do
            if s:isPlayer() then         
                s:sendChannelMessage("", string.format(STATUSDEFAULT.messages.channel_slower.msg, creature:getName()), STATUSDEFAULT.messages.channel_slower.type, STATUSDEFAULT.channelID)
            end
        end
    end
 
Solution
Back
Top