• 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.0 Function Help

fagotti

New Member
Joined
Nov 6, 2014
Messages
12
Reaction score
2
A need help whit this function


Code:
    local specs = Game.getSpectators(zeWaitingRoomPos, false, true, 0, zeWaitingRoomRadiusX, 0, zeWaitingRoomRadiusY)
   
        for i = 1, #specs do
            specs[i]:teleportTo(zeZombieArena)
        end

she is not working

give this error

Screen_Shot_11_26_14_at_10_51_PM.png


need a function that teleport all players in a given area
 
Last edited:
Code:
    for _, spectator in ipairs(specs) do
        spectator:teleportTo(zeZombieArena)


give this erro now

Screen_Shot_11_27_14_at_10_39_AM.png



Code:
local specs = getSpectators(configZom.zomsalaespera, false, true, 0, configZom.zomesperax, 0, configZom.zomesperay)


for _, spectator in ipairs(specs) do
        spectator:teleportTo(zeZombieArena)
        end
 
I'm not sure what the specs variable contains, you can try to use "pairs" instead of "ipairs" or just this;
Code:
for _, spectator in specs do
    spectator:teleportTo(zeZombieArena)
end

But it'd be interesting to know what specs contains, you should implement a function like this: http://lua-users.org/wiki/DataDumper, to see the depths of the array.

Ignazio
 
Back
Top