I made a script that's supposed to disable a script, as well as its subscripts and sounds inside it, and play a message when the button is clicked.
However, after disabling the script and its contents, it re-enabled it. I want the script to be disabled permanently upon clicking the button.
S1 = game.Workspace.SDS
function onClick()
S1.Disabled = true
S1.SDS2.Disabled = true
S1.Alarm0:Stop()
S1.Alarm1:Stop()
S1.Alarm2:Stop()
S1.Alarm3:Stop()
S1.Alarm4:Stop()
S1.Fire:Stop()
S1.movement:Stop()
script.Parent.ClickDetector.MaxActivationDistance = 0
local hint = Instance.new("Hint", game.Workspace)
hint.Text = "Script Turned Off."
end
script.Parent.ClickDetector.MouseClick:connect(onClick)

4 comments
Why not just destroy the script then?
I'll be needing the script after it's disabled eventually, as there will be another button to re-enable the script.
Why separate scripts, when you can just compact them together with their own separate functions?
Actually, I think that would work. Resolved.