Why doesn't this work?

I want to make a button that pulls up or down the volume of a video. From the begining, .Volume is set to 100. When you clcik the +volume, the volume goes up +1, like this:

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent:FindFirstChild("VideoFrame").Volume = +1
end)

And the -volume:

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent:FindFirstChild("VideoFrame").Volume = -1
end)

why doesn’t it work?

1 Like

This is on my script analisis.
image

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent:FindFirstChild("VideoFrame").Volume += 1
end)
script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent:FindFirstChild("VideoFrame").Volume -= 1
end)
1 Like

Seems like the video doesn’t have noise. Sorry.

It doesn’t matter if your video have noise or not, every video have volume property.
the thing is you are changing value operator. ( + - = - or - - = + thing)

Try -= or += instead.
Example:

videoFrame.Volume += 1
videoFrame.Volume -= 1

Or

videoFrame.Volume = videoFrame.Volume + 1
videoFrame.Volume = videoFrame.Volume - 1

Yours:

Current method:
image
output:
image

@EOASTUDIO Cmon all videos are volume property, there is a video with no such things as no volume property

1 Like

I said the vídeo doesnt contain noise, not that it doesnt have volume property.

1 Like