How to add more of the function?

I want to add more of them 3, 4, 5 and 6. But I am not too good at scripting.
(more of them:
tool.Handle.Scroll2A.Transparency = 1
tool.Handle.Scroll2B.Transparency = 1
activated = false)

local tool = script.Parent
local activated = false

tool.Activated:Connect(function()
    if(not(activated))then
        tool.Handle.Scroll1A.Transparency = 1
        tool.Handle.Scroll1B.Transparency = 1
        activated = true
    else
        tool.Handle.Scroll2A.Transparency = 1
        tool.Handle.Scroll2B.Transparency = 1
        activated = false
    end
end)

Could you elaborate on what you mean when you want to add more of them?

1 Like

Try using elseif instead of else
for example:

if yes == true then
yes = false
elseif yes == false then
yes = true
elseif yes == false and no == true then
yes = true
no = false

if this is what you mean.

1 Like

What does that mean, can you explain what function means?

1 Like

Like adding more of this

        tool.Handle.Scroll2A.Transparency = 1
        tool.Handle.Scroll2B.Transparency = 1
        activated = false
1 Like

What do you mean, you are being (EXTREMELY) vague in this post

1 Like

So like basically adding Scroll3, Scroll4, Scroll5, Scroll6 like my script above.

I apologize if this is very confusing.

Then just add them, there is no limit unless you want your game to lag.

I tried but I am getting errors.

Can you show me them? I could solve your problem.

I am sorry if the script is stupid, since I am bad at scripting.

local activated = false

tool.Activated:Connect(function()
	if(not(activated))then
		tool.Handle.Scroll1A.Transparency = 1
		tool.Handle.Scroll1B.Transparency = 1
		activated = true
	else
		tool.Handle.Scroll2A.Transparency = 1
		tool.Handle.Scroll2B.Transparency = 1
		activated = false
	else
		tool.Handle.Scroll3A.Transparency = 1
		tool.Handle.Scroll3B.Transparency = 1
		activated = false
	else
		tool.Handle.Scroll4A.Transparency = 1
		tool.Handle.Scroll4B.Transparency = 1
		activated = false
	else
		tool.Handle.Scroll5A.Transparency = 1
		tool.Handle.Scroll5B.Transparency = 1
		activated = false
	else
		tool.Handle.Scroll6A.Transparency = 1
		tool.Handle.Scroll6B.Transparency = 1
		activated = false
	end
end)

What is the error you are getting?

image

That’s not an error. Go to the view tab, and press output, then run your game and show any red text that’s in there.

What is the point of all the other else ​statements?

You’ve put too many else statements, there can only be only 1 else at the very end. If you want to have a condition to check like at the very start, then use else if.

Can you explain what you’re trying to do

This is based on my previous post, How to make it activated twice and not at the same time - #2 by Emskipo.