Values not being changed?

I am making an AND gate and the values do not seem to be changing when i click the buttons.

Here’s a look inside:
robloxapp-20230619-2110434.wmv (669.5 KB)




1 Like

You have to change if statement.

local input = script.Parent.Output
local bulb = script.Parent.Parent.Bulb

while true do
	wait(0.001)
	if input.Value == true then
		bulb.Material = Enum.Material.Neon
		bulb.Transparency = 0
	else
		bulb.Material = Enum.Material.SmoothPlastic
		bulb.Transparency = 0.7
	end
end
2 Likes

This can help:

2 Likes

Your problem is that your input variable is getting the initial value. Instead it should get the instance so it should look like this

local input = script.Parent.Output

But what you have right now is this

local input = script.Parent.Output.Value

Then you just need to change every usecase from input to input.Value

3 Likes

I tried to apply you guys’ changes, but I can’t seem to fix it. Here’s the link to the model i made

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.