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

I need help on this script!?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Hi, I have a minor problem with this script. This script finds out if the 'ColorChange' script is Disabled, it changes the Color of the PointLight back to normal instead of frozen in colors.

Here is the script.

if script.Parent.ColorChange.Disabled = true then -- This is where I get my minor problem, which it's underlined in red.
script.Parent.Color = Color.new(255,255,255)
end

2 answers

Log in to vote
2
Answered by 9 years ago

You need to use two equal signs if you're comparing values. Also, Color3.new takes numbers between 0 and 1, not 0 and 255.

if script.Parent.ColorChange.Disabled == true then
script.Parent.Color = Color3.new(1,1,1)
end
Ad
Log in to vote
0
Answered by 9 years ago

Thankyou VerifiedName for the script. I have tried it - but the script crashes the main buttons on a SurfaceGui, this is not a problem - but it just crashes up the buttons. Sometimes, the script can crash the Dynamic Lighting for my disco lights which it can stay frozen (It doesn't change the colour).

So I am just wondering if anyone can put these two separate scripts into one main script, because I don't know if it needs changing or where it goes and etc...

So here is the two scripts.

This script controls the main buttons for the light.

function change()
for i = 1, 11 do
workspace:FindFirstChild("DynamicLight"..i).PointLight.ColorChange.Disabled = not workspace:FindFirstChild("DynamicLight"..i).PointLight.ColorChange.Disabled
if workspace:FindFirstChild("DynamicLight"..i).PointLight.ColorChange.Disabled == true then
script.Parent.Text = "Mode: Regular Mode"
else
script.Parent.Text = "Mode: Disco Mode"
end
end
end

script.Parent.MouseButton1Down:connect(change)

And this...

This script normally stays in the PointLight as a parent, but it crashes the whole thing. But this script controls the Color of the PointLight back to default white. When the other script is disabled which it's called "ColorChange", ColorChange is another script which it's in the PointLight as a parent.

if script.Parent.ColorChange.Disabled == true then
script.Parent.Color = Color3.new(255,255,255)
end

I know this can be hard, but expert scripters can figure it out!

0
Anyone? BenHall4433 0 — 9y

Answer this question