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

why doesnt this kick the player?

Asked by 5 years ago

i want the player to get kicked if they dont have a certain gamepass or not have admin in their backpack this is a server script:

local firstpos
while wait() do
    for i,v in pairs(game.Workspace:GetChildren()) do
        if v:FindFirstChild("HumanoidRootPart") then
            if v.Humanoid.Sit == false then
            local person = v.HumanoidRootPart
            firstpos = person.Position
            wait(1)
            if (firstpos - person.Position).magnitude > 32 then
                print((firstpos - person.Position).magnitude)
                local player = game.Players:GetPlayerFromCharacter(person.Parent)
                if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,6451920) or player.BackPackFindFirstChild("admin") then
            print("wont kick u bruh")
                else
                    player:Kick("im better")
                end
            end
            if v.Humanoid.Sit == true then
                local person = v.HumanoidRootPart
            firstpos = person.Position
            wait(1)
            if (firstpos - person.Position).magnitude > 166 then
                print((firstpos - person.Position).magnitude)
            local player = game.Players:GetPlayerFromCharacter(person.Parent)
            player:Kick("silly u, im better")
            end
            end
            end
    end
end

Answer this question