I want my game to have a part that if I walk onto it the server gets shutdown. Sort of like when you play an obby and touch a lava jump you die for touching it.
This is my old script that works by displaying my messages I have in the script then shutting it down after I pressed a button with my mouse:
function onClicked()
p= game.Players:GetChildren()
for i= 1, #p do
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "Server being shut down, sorry for any inconvience"
wait(3)
p[i]:Remove()
wait(3)
m.Text = "Bye"
wait(1)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Please give me a script that would work if possible or tell me how I could make it work. I would like to have one that does not have messages in it. Thank you.

3 comments
This isn't a request site. All you have to do is apply the same logic in your code above, to a Touched event. If you haven't looked into how events work, you probably shouldn't be posting a question ahead of it yet.
yep, script.Parent.Touched:commect(onClicked);
@scottmike, I'm sensing a commection.