Code : while true do wait() local sound = script.Parent.Parent.Zombie script.Parent.Position = script.Parent.Position + 1+((sound.PlaybackLoudness/1000)*3.5) end
COMMUNITY QUESTION
How do i make a part move with Y Value on how loud the volume is?
2 answers
Hello, MadnessMyth!
while true do
wait()
local sound = script.Parent.Parent.Zombie
script.Parent.Position = script.Parent.Position + Vector3.new(0, 1+((sound.PlaybackLoudness/1000)*3.5), 0) -- script.Parent.Position is a Vector3 value
end
If this code don't works, please post a comment to this answer that i'll try to fix it
2 comments
0
it only goes up and not back down.
0
I kinda fixed it? i wanted it to be like half life 2 mouth movement talking
while true do
wait()
local debounce = true
local vecPoint = Vector3.new(0,0,0)
local closestPlayer, smallestMagnitude = nil,math.huge
if debounce then
for _, player in pairs(game.Players:GetPlayers()) do
local distance = player:DistanceFromCharacter(vecPoint)
if distance < smallestMagnitude then
debounce = true
smallestMagnitude = distance
closestPlayer = player
wait(2.5)
print (distance)
debounce = false
end
end
end
-- create a sound
local sound = Instance.new("Sound", game.Workspace)
sound.SoundId = "rbxassetid://4277136473" -- change this to your game id
sound.Looped = true -- do you want it looped if yes then leave it
sound.PlaybackSpeed = 1
-- make the sound loud
sound.Volume = 2-- the voloume
-- play the sound
sound:Play()-- tells the script to play
-- waits 7 seconds
-- make the sound quiet
sound.Volume = 0.3
end
1 comment
0
its in studio No game.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Put your code in a code block
i dont know how to put it in code block im new to this website