Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to disable a script through a GUI?

Asked by 9 years ago

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)
0
Have you created this snow effect? Have you simply considered making the snow effect more efficient? BlueTaslem 18071 — 9y
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. TheRings0fSaturn 28 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

script.Parent.Disabled = false

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

Ad

Answer this question