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

Why is my Script not working when the Value is the same Value as I said!?

script.Parent.Parent.Parent.Minus.MouseButton1Click:connect(function(pro)
	if script.Parent.Value = script.Parent.valuezer.Value then
		script.Parent.Parent.LocalScript.Disabled = true
		script.Parent.Parent.value.Disabled = true
	else 
		script.Parent.Parent.LocalScript.Disabled = false
		script.Parent.Parent.value.Disabled = false
	end
end)
script.Parent.Parent.Parent.Plus.MouseButton1Click:connect(function(pro)
	if script.Parent.Value = script.Parent.valueten.Value then
		script.Parent.Parent.LocalScript.Disabled = true
		script.Parent.Parent.value.Disabled = true
	else 
		script.Parent.Parent.LocalScript.Disabled = false
		script.Parent.Parent.value.Disabled = false
	end
end)


I want if button Minus is pressed it checks if the Parent of the script is 0 then it disables the script that changes the Volume of something else The same with the Plus It says

Players.("MY NAME").PlayerGui.SettingsGui.LeftSide.Music.Frame.VolumeDisplay.Displa:2: 'then' expected near '='

valuezer value is 0 and valueten is 10

2 comments

0

In the if statements use double == instead of one =

0

Srry that I spelled u name wrong in my answer lololol

1 answer

✓ Accepted answer

Just like MooMooTahlahlah said, you need to put double "==" instead of "=" in the if statements, this means that you are checking something or something like that. This also counts as making elseif statements.

script.Parent.Parent.Parent.Minus.MouseButton1Click:connect(function(pro)
    if script.Parent.Value == script.Parent.valuezer.Value then
        script.Parent.Parent.LocalScript.Disabled = true
        script.Parent.Parent.value.Disabled = true
    else
        script.Parent.Parent.LocalScript.Disabled = false
        script.Parent.Parent.value.Disabled = false
    end
end)
script.Parent.Parent.Parent.Plus.MouseButton1Click:connect(function(pro)
    if script.Parent.Value == script.Parent.valueten.Value then
        script.Parent.Parent.LocalScript.Disabled = true
        script.Parent.Parent.value.Disabled = true
    else
        script.Parent.Parent.LocalScript.Disabled = false
        script.Parent.Parent.value.Disabled = false
    end
end)

2 comments

0

Its not working it doesnt stop at 0 and it says not 0 its says somethng like 1.378886786786779e-16

0

OH I needed to use string value thankks

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