Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a part move with Y Value on how loud the volume is?

Asked by 5 years ago

Code : while true do wait() local sound = script.Parent.Parent.Zombie script.Parent.Position = script.Parent.Position + 1+((sound.PlaybackLoudness/1000)*3.5) end

0
Put your code in a code block JesseSong 3916 — 5y
0
i dont know how to put it in code block im new to this website MadnessMyth 10 — 5y

2 answers

Log in to vote
1
Answered by
Leamir 3138 Moderation Voter Community Moderator
5 years ago

Hello, MadnessMyth!

1while true do
2wait()
3local sound = script.Parent.Parent.Zombie
4script.Parent.Position = script.Parent.Position + Vector3.new(0, 1+((sound.PlaybackLoudness/1000)*3.5), 0) -- script.Parent.Position is a Vector3 value
5end

If this code don't works, please post a comment to this answer that i'll try to fix it

0
it only goes up and not back down. MadnessMyth 10 — 5y
0
I kinda fixed it? i wanted it to be like half life 2 mouth movement talking MadnessMyth 10 — 5y
Ad
Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago
01while true do
02    wait()
03    local debounce = true
04local vecPoint = Vector3.new(0,0,0)
05local closestPlayer, smallestMagnitude = nil,math.huge
06if debounce then
07 
08 
09 
10for _, player in pairs(game.Players:GetPlayers()) do
11     local distance = player:DistanceFromCharacter(vecPoint)
12     if distance < smallestMagnitude then
13    debounce = true
14          smallestMagnitude = distance
15          closestPlayer = player
View all 37 lines...
0
its in studio No game. MadnessMyth 10 — 5y

Answer this question