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

Solved Remove player when he is on a nil tile - TFS 1.2

Status
Not open for further replies.
Joined
Jul 18, 2014
Messages
193
Solutions
2
Reaction score
15
Hi!, i want to create an script which helps me to remove players who fall in a nil tile, that is to say in a place where there isn't floor.
I was thinking in something like this:
Code:
function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        local t = Tile(player:getPosition())
        if t == nil then
            player:remove()
        end
    end
    return true
end

But nothing happens. It has an interval of 30 to be quick.
Somebody can help me, please?
Thanks.
PD: Im using TFS 1.2.
 
Hi!, i want to create an script which helps me to remove players who fall in a nil tile, that is to say in a place where there isn't floor.
I was thinking in something like this:
Code:
function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        local t = Tile(player:getPosition())
        if t == nil then
            player:remove()
        end
    end
    return true
end

But nothing happens. It has an interval of 30 to be quick.
Somebody can help me, please?
Thanks.
PD: Im using TFS 1.2.

Try this:
Code:
function onThink(interval)
    for _, player in ipairs(Game.getPlayers()) do
        local t = Tile(player:getPosition())
        if t == nil or t:getGround() == nil then
            player:remove()
        end
    end
    return true
end
 
Status
Not open for further replies.
Back
Top