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

How to kick players with Proximity Prompt?

Asked by 2 years ago

I'm making a game and wanted to know how players can kick themselves by pressing 'E to interact', any suggestions?

1 answer

Log in to vote
0
Answered by 2 years ago

It's not that hard to do, we can just connect the ProximityPrompt's Triggered event that will fire the player that activated the prompt, we would just kick that player using Player:Kick. Let's assume this script is inside the part with the proximity prompt

-- Inside the part that will kick you, needs a proximityprompt
local part = script.Parent
local proximityPrompt = part.ProximityPrompt -- Your proximity prompt

proximityPrompt.Triggered:Connect(function(player) -- When the prompt is triggered
    player:Kick("lol don't interact with this part") -- Kick the player
end)
0
Thanks! superfreddycool 4 — 2y
Ad

Answer this question