Value change not happening

Once again, I’m asking for help on here. I’m currently making a simple fire system and I want it to notice if a value changes and if it does to then start a fire. But for some reason it’s doing nothing when the Value changes… I really need help and hope some of you more experienced scripters have a fix for me!

local RS = game:GetService("ReplicatedStorage")
local Auto = RS:WaitForChild("Automation")

--Auto. Events--
local Feuer = Instance.new("Fire")



script.Parent.Values.B1.changed:Connect(function(valuee1)
	if valuee1 == true then
		print("V1")
		Auto:FireClient()
		for _, child in ipairs(workspace.MelderSys.Feuer.B1:GetChildren()) do
			Feuer = child
	end
end



end)
script.Parent.Values.B2.Changed:Connect(function(valuee2)
	if valuee2 == true then
		print("V2")
		Auto:FireClient()
		for _, child in ipairs(workspace.MelderSys.Feuer.B2:GetChildren()) do
			Feuer = child
	end
end



end)
script.Parent.Values.B3.Changed:Connect(function(valuee3)
	if valuee3 == true then
		print("V3")
		Auto:FireClient()
		for _, child in ipairs(workspace.MelderSys.Feuer.B3:GetChildren()) do
			Feuer = child
			end
		end
	end)

Are V1, V2 and V3 printed or no?

No they aren’t that’s why I said nothing happens.

Check what you are passing through. The Change passes through a property name and not a value.

Instead try

if script.Parent.Values.B1[value1] == true do

Check out Instance | Roblox Creator Documentation
The value is the NAME of the property and not the VALUE.

Hope this helps :smiley:

Hi! I actually have been there a few times, I didn’t want to write another thing on here but I didn’t manage to do it on my own. Thank you for your post I will try it later when I’m back!

1 Like

I think this isn’t the error, but in

and in

you forgot to end the function for. I don’t know if this is the error, but fix this.

Hi there! Could you tell me what you exactly mean by “You forgot to end the function for” I don’t really know how to close it more than with
end)

Are ‘valuee1’ and ‘valuee2’ defined somewhere else? If there’s no parameters in a function how could it be true?

Like programming in most settings, generally everything is case-sensitive. Roblox is no different.

It looks like a typo possibly? For “B1”. ‘changed’ should be ‘Changed’

There’s end to the function and for the if, but you didn’t put the end to the for.

I had this problem today, Idk why but when I did Object.AncestryChanged:Connect(function() end) it started updating again.

Weird gonna try that soon, seems like it’s worth a try that way I can finally finish this project lol

Just to let you know, you DO have proper 'end’s for the functions, its just your indentation that makes it look like there is not.

Also… I think I see the problem, Changed returns the ‘property’ that was changed, so, instead of …
if valuee1 == true

try…
if script.Parent.Values.B1.Value == true