I have a script (see below) and I wanted to make it so that if the values name isn't "Fifteen" then it will set the value of that value(?!) to zero.
function onTouch(part) if bus:FindFirstChild("Fifteen")then bus.Fifteen.Value = bus.Fifteen.Value + 15 else -- I was thinking you could create a list of all other possible names for the value here and set the value to zero if one of them exists? end end
MD
First, make sure bus is defined.
Other than that, I'm not sure what you want.
I'll answer based on what I think you want.
local values = {"","","","","","","",""} --Creates a list of values (make sure you put in the correct names) function onTouch(part) if bus:FindFirstChild("Fifteen")then bus.Fifteen.Value = bus.Fifteen.Value + 15 else for i,v in pairs(values) do --Loop through values if bus:findFirstChild(v) then --If the current value exists, v.Value = 0 --Set it to 0. end end end end