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
~~~~~~~~~~~~~~~~~
1 | script.Parent.Num.Value.Changed:Connect( function (t) |
2 | if t = = 4 then |
3 | script.Parent.Sound:Play() |
4 | end |
5 | end ) |
1 | script.Parent.Num:GetPropertyChangedSignal( "Value" ):Connect( function () |
2 | if script.Parent.Num.Value = = 4 then |
3 | script.Parent.Sound:Play() |
4 | end |
5 | 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:
1 | if script.Parent.Num.Value = = 4 then |
2 | script.Parent.Sound:Play() |
3 | end ) |
You'll need to check if it changes, then check if the change is 4.
1 | script.Parent.Num.Value.Changed:Connect( function (newval) |
2 | if newval = = 4 then |
3 | script.Parent.Sound:Play() |
4 | end |
5 | end ) |