Code : while true do wait() local sound = script.Parent.Parent.Zombie script.Parent.Position = script.Parent.Position + 1+((sound.PlaybackLoudness/1000)*3.5) end
Hello, MadnessMyth!
1 | while true do |
2 | wait() |
3 | local sound = script.Parent.Parent.Zombie |
4 | script.Parent.Position = script.Parent.Position + Vector 3. new( 0 , 1 +((sound.PlaybackLoudness/ 1000 )* 3.5 ), 0 ) -- script.Parent.Position is a Vector3 value |
5 | end |
If this code don't works, please post a comment to this answer that i'll try to fix it
01 | while true do |
02 | wait() |
03 | local debounce = true |
04 | local vecPoint = Vector 3. new( 0 , 0 , 0 ) |
05 | local closestPlayer, smallestMagnitude = nil , math.huge |
06 | if debounce then |
07 |
08 |
09 |
10 | for _, 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 |