I need it so that if you click a part it kicks you from the game.
✓ ANSWER ACCEPTED
How do I make it so that if you click a part it kicks you?
2 answers
✓ Accepted answer
Place a Click Detector in the part
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.
