Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make it so that if you click a part it kicks you?

I need it so that if you click a part it kicks you from the game.

2 answers

✓ Accepted answer
  1. Place a Click Detector in the part

  2. Place a script inside the Click Detector

3.Paste this code below inside the script

local Click = script.Parent
Click.MouseClick:Connect(function(Player)
Player:Kick("TEST") --rename TEST to whatever you want your message to be
end)

add clickdetector to the part, and add a script with

script.Parent.clickdetector.MousClick:Connect(function(plr)

and the plr is an automatic input value, whenever a player clicks a clickdetetcor, the game automatically send the player instance to any functions that is listening to the clickdetector like that script, then to kick the player, use

plr:kick([message])

This discussion is preserved as it was. New answers, comments, and votes are closed.