I’m working on a Settings GUI where the player can hold click and move the mouse on the slider to change the volume of sounds. I coded so whenever the player moves one of the sliders, a NumberValue in workspace will be changed to the corresponding value. What happens is that whenever a mob spawns, I want the volume of the sound to be the value in the NumberValue of Workspace. (Sound is in HumanoidRootPart)
-
How can I make it so it updates every time using a “Repeat Until”? (I made one with while true do but idk if it will cause a server overload/lag whenever there are a lot of mobs)
-
I made a script but whenever the mob spawns, the script does not work for some reason.
LocalScript inside of the mob’s HumanoidRootPart;
local value = game.Workspace.Val.Value
local HRP = script.Parent
while true do
wait(1)
print("1")
for i, v in pairs(HRP:GetChildren()) do
print("2")
if v:IsA("Sound") then
print("3")
print("Sound name is: ", v)
while true do
wait(1)
v.Volume = value
end
end
end
end