:Changed Function logical issue

I’ve came to the issue now that being I am using a .Changed value, I am trying to now see how I could go about now checking for the .CRSE and not breaking /overwriting something in the loop. I am having a hard time figuring out where to go from here. Thanks in advanced for the help!

script.Parent.on.Changed:Connect(function(val)
	if script.Parent.on.Value == 2 then
		repeat
		until script.Parent.on.Value ~= 2 or script.Parent.CRSE.Value == true
	elseif script.Parent.on.Value == 3 then
		repeat
		until script.Parent.on.Value ~= 3 or script.Parent.CRSE.Value == true
	else
	end
end)
1 Like

Are you Italian? Because your code looks like spaghetti to me.

Jokes aside, what is this supposed to do? Or is it only a snippet?

1 Like

a few things

why is val a parameter if its never used
empty else statement

repeat
untill script.Parent.on.Value ~= 2 or script.ParentCRSE.Value == true

i have no clue what ur attempting here, please elaborate

1 Like

Snippet, it’s basically a overriding system due to the fact that the code inside is critical to the items and has information in it. I’m trying to get it so when CRSE is on, it overrides the On value, and when CRSE is off, it goes back to what on was doing.