Here is what I have but it won't work. It has no output:
local a = script.Parent.Parent.Parent.Parent.Health.Health function shutdown() if a.Value >= 25 then script.Parent.Sounds.Prepare:Play() wait(2) script.Parent.Sounds.Siren:Play() end end a.Changed:connect(shutdown)
I think Changed
is a member of objects, not properties. So, if a property of the given object changes, it calls the connected function with the changed property as an argument.
So, change the last line accordingly.
a.Changed:connect(shutdown)
1.Seriously? No output? When i copied and adapted your script, I got something like this
16:21:06.772 - Workspace.Script:9: attempt to index field 'Value' (a number value)
This happened because Changed
event is related to the object, and you indexed it to a property. So, where you have
a.Value.Changed:connect(shutdown)
You should have
a.Changed:connect(shutdown) -- changed fires when one of the properties of the object changes, and you can't point it to a property