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

How to disable a script through a GUI?

The game I've created has snow, which bogs down just about everyone's computer. I was wanting to know how to disable the script through a GUI.

My Current code that disables the script:


for i, b in ipairs(script.Parent:GetChildren()) do
	if b:IsA("TextButton") then
		b.MouseButton1Down:connect(function()
		script.Parent.Snow.Enabled = false
		end)
		b.MouseButton1Up:connect(function()
		script.Parent.Snow.Enabled = false
		end)
	end
end

game.Players.LocalPlayer:GetMouse().Button1Up:connect(function()
end)

2 comments

0

Have you created this snow effect? Have you simply considered making the snow effect more efficient?

0

Yes. I've created the snow script, but I don't know how to optimize it. It's a local script, and the snow is made out of parts.

1 answer

✓ Accepted answer

script.Parent.Disabled = false

Replace all of the "Enabled" with "Disabled".

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