This is the script i have made. "then" and "end" are red underlined and it wont work. ~~~~~~~~~~~~~~~~~
script.Parent.Num.Value = 4 then script.Parent.Sound:Play() end
~~~~~~~~~~~~~~~~~
script.Parent.Num.Value.Changed:Connect(function(t) if t == 4 then script.Parent.Sound:Play() end end)
script.Parent.Num:GetPropertyChangedSignal("Value"):Connect(function() if script.Parent.Num.Value == 4 then script.Parent.Sound:Play() end end)
if you still have errors, or you want to ask other things, simply dm me on discord
Multiple issues with your code;
Here is the fixed version:
if script.Parent.Num.Value == 4 then script.Parent.Sound:Play() end)
You'll need to check if it changes, then check if the change is 4.
script.Parent.Num.Value.Changed:Connect(function(newval) if newval== 4 then script.Parent.Sound:Play() end end)