Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Fix to remove a nil player?

Asked by 8 years ago

Right now, for my admin script, I know how to get the people who are nil, but how do I kick then since this won't work?

local S = game.NetworkServer

for _,v in pairs(S:GetChildren()) do
    local A = v:GetPlayer()
    if game.Players:findFirstChild(A.Name) then
        print(A.Name.." is here.")
    else
        print(A.Name.." is nil!")
        v:Destroy()
    end
end
0
How about trying game.Players.PlayerRemoving:connect(function(plr) plr:Kick() end) I've seen it presented in a admin script, and I would think it would work as the PlayerRemoving event is fired as the player leaves the server, the client then becomes disconnected. M39a9am3R 3210 — 8y

Answer this question