I’m trying to check if 1 of 3 values has been changed but it doesn’t seem to work and I can’t see any solution so far, I tried to search a solution but couldn’t find. script:
local ReplicatedStorage = game.ReplicatedStorage
local X = ReplicatedStorage.X
local Y = ReplicatedStorage.Y
local Z = ReplicatedStorage.Z
if X.Changed:Connect(function() or Y.Changed:Connect(function() or Z.Changed:Connect(function()
print("something changed!")
end)
end)
end)
end
This doesn’t work, because the functions are inside of each other. You can’t call a function and another one in the same line. You need to make 3 seperate functions.
Edit: @Skidouski already sent the correct answer. Make sure to mark his answer as the solution!
local function Changed(Changed)
print(Changed)
end
X.Changed:Connect(function()
Changed("X")
end)
Y.Changed:Connect(function()
Changed("Y")
end)
Z.Changed:Connect(function()
Changed("Z")
end)