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

best way to remove the player as soon as they join?

Asked by
rokedev 71
5 years ago

no clue why this doesnt work, its in a localscript

local Players = game:GetService("Players") local player = game.Players.LocalPlayer Players.PlayerAdded:connect(function() player.Humanoid:Destroy() end)

0
Maybe just try replacing `Players.PlayerAdded` with `player.CharacterAdded` TheSkyofIndia 150 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

you can use the :Kick(") function to kick someone when they join a game like this:

game.Players.PlayerAdded:Connect(function(player)
    player:Kick("ahahhaha") -- you can put any message in the parameters
end)

this would only work in server scripts in workspace or serverscriptservice, since PlayerAdded only runs in the server so thats why ur script wont work. you can also use the parameter in PlayerAdded to get the player instead of using localplayer which only can be accessed in local scripts.

destroying the humanoid of the player wont remove the player, but just break the character.

0
i mean more like the camera still exists but the actual palyer just commits not alive rokedev 71 — 5y
Ad

Answer this question