Player:Kick() not working?

Something to check before you read the rest: I believe the kicked message is part of the core GUI. If you turned off parts or all of the core GUIs this may be your problem. Double check that none of your code unintentionally turning off the wrong parts or the core GUI.

The other player is being kicked/disconnected by the client isn’t displaying the message. This is probably either from a malfunctioning Roblox player application or some sort of setting in your game. Some ways you can see what the problem is are:
Make a blank baseplate and run a simple kick script
—There is some script messing with your coreGuis or settings
Try making your game public and running the game from another device
—If this works normally then it is your Roblox application

Edit: The kick menu is not in core GUI and there is no (know) way to turn it off.

If this is done correctly, should not have any problems.

Are you overriding your script environment? What kind of scripts run in your game?

It’s more likely that you aren’t doing it correctly. The server cuts the connection between the server and the client, it’s a C-Function. It would be possible that maybe your server is out of date. Please make sure it is, and if it’s not up to date you need to post it to bugs.

can you put this script inside a part

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then -- just to see if its a real player
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        -- kicking
        player:Kick("this was a test kick!")
    end
end)

im sure this should work probably

Terrain automatic generation program is running

Is this running in a studio team test or a real roblox server?

Can you send me the full script, my guess is that the kick feature is working but you never called the function or called it incorrectly.

1 Like

It didn’t work. same problem.

1 Like

Real roblox server.

This just happened to me too when I tested!
It is a Roblox bug, I think we should let them fix this error.

Save the game locally to a file try running it from that file.

Isn’t the point that it doesn’t work on a real server? I don’t see why they should run it locally.

If it is a Roblox error then moving the script to a new game or saving it locally would fix the problem otherwise it’s a scripting problem, I still don’t have the full context so I can’t tell exactly what’s going on.

1 Like

It works! but why real server don’t kick player?

This seems like a roblox problem, especially as it works in studio for them.

2 Likes

It’s a roblox error, just save the game to a new place and it’ll work on roblox.

1 Like

I tried it. It didn’t work.

It is a Roblox error, I suggest just giving it some time until they fix it.

1 Like

Make sure you’re publishing to a completely new place, try again in a day and it could work.
Consider posting it as a bug in the engine bugs.

1 Like

With help from a remoteEvent, Yes.

No, server kicking by itself is just fine.