I just want to know how I can make a slider like this that can change the volume of a sound
how can i make the slider in the first place and how can i code it so that it changes the volume?
I just want to know how I can make a slider like this that can change the volume of a sound
how can i make the slider in the first place and how can i code it so that it changes the volume?
If the Slider is in an indivual frame than that is good since the position will be detemined by the frame.
So you could do:
-- make your moving ability for the slider
local RunService = game:GetService("RunService")
local Slider = -- get path
local BoomboxSound = -- get path
RunService.RenderStepped:Connect(function()
local SliderPosition = Slider.Position
BoomboxSound.Volume = SliderPosition.X.Scale
end)
why would i get RunService? just curious
Continous Updating and I am not sure if GetPropertyChangedSignal(“Position”) works, you could do that too if it works
-- not sure if that works too, but you can try out
local Slider = -- get path
local BoomboxSound = -- get path
Slider:GetPropertyChangedSignal("Position"):Connect(function()
local SliderPosition = Slider.Position
BoomboxSound.Volume = SliderPosition.X.Scale
end)
(i advice RunService though)
the first one works the second doesnt so ill give that the solution ty
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.