In the past, usually from exploiters and on scriptbuilder, I have seen people crashing other players 'clients' not their game, just the client. So when they do that a message shows saying 'You have lost connection to the game'.
I've tried many ways and they will not work. Here are a couple
Player:Kick("You have been kicked!") -- Serversided only Instance.new("RemoteEvent",workspace):FireClient(Plaer,{string.rep("Boom",2e5+5)}) -- Serversided only Player:remove() -- Kicks but no message on screen, player 'still in the game'
If you know any ones that do show a message saying 'You have lost connection to the game' aka crashing their clients, please do tell me!
Thanks
~ Expression
To crash the player in a local script, all you would really have to do is run a while true do loop.
while true do end-- this is is
But you shouldn't do this. You can send a message to a server telling it to Kick the player using Remote Events.
To use this, simple get the player you want on the server, in a regular script, and use Kick on them.
--// Regular Script; Server Sided local plr = game.Players.OldPal plr:Kick()
This will disconnect the player's client from the server.
You can also display a message.
--// Regular Script; Server Sided ocal plr = game.Players.OldPal plr:Kick("You have been kicked for being a meany")
Now to set the code up with Remote Events is rather easy. Simple make a Remote Event in ReplicatedStorage, define this in both of the scripts, and fire and do stuff when the signal is received.
--// Local Script local RE = game:GetService("ReplicatedStorage"):WaitForChild(""RemoteEvent) local plr = game:GetService("Players").LocalPlayer function KickPlayer() RE:FireServer() -- Kicks player end
and
local RE = game:GetService("ReplicatedStorage"):WaitForChild(""RemoteEvent) RE.OnServerEvent:Connect(function(plr) plr:Kick("Kicked") end)
It's as simple as that.