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

Why is it not kicking the Player?

Asked by 2 years ago

I'm trying to kick the player when they touch a block

local kickRE = game:GetService("ReplicatedStorage"):FindFirstChild("KickPlayer") -- Remote Event to kick players
local Players = game:GetService("Players") -- Defining Players

kickRE.OnClientEvent:Connect(function()

    Players:Kick() -- Kicking the Player

end)

Can anyone tell me why it isn't kicking the Player please?

0
hey, can you tell me if the script is a local script or a server script? NarwhalAndMe 141 — 2y
0
Tis' a LocalScript WeaponisedPenguins 97 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Since this is a local script, you just have to put the script in StarterPack or somewhere local.

Then do (on line 6):

Players.LocalPlayer:Kick() -- Kicking the Player
Ad

Answer this question