Fixed! Thank you youtube master wow, I had to put a modification at the end to make it not glitch out and be weird, thank you!
01 | while true do |
02 | wait() |
03 | if game.Workspace.NPC.Head.speach.PlaybackLoudness < = 65 then |
04 | game.Workspace.NPC.Head.Mouth.Texture = "rbxassetid://2801767831" |
05 | elseif game.Workspace.NPC.Head.speach.PlaybackLoudness < = 75 and game.Workspace.NPC.Head.speach.PlaybackLoudness > 65 then |
06 | game.Workspace.NPC.Head.Mouth.Texture = "rbxassetid://2801751501" |
07 | elseif game.Workspace.NPC.Head.speach.PlaybackLoudness < = 85 and game.Workspace.NPC.Head.speach.PlaybackLoudness > 75 then |
08 | game.Workspace.NPC.Head.Mouth.Texture = "rbxassetid://845217767" |
09 | elseif game.Workspace.NPC.Head.speach.PlaybackLoudness < = 95 and game.Workspace.NPC.Head.speach.PlaybackLoudness > 85 or game.Workspace.NPC.Head.speach.PlaybackLoudness > 75 then |
10 | game.Workspace.NPC.Head.Mouth.Texture = "rbxassetid://907601394" |
11 | end |
12 | end |
Hello. The problem is that you wrote <=
which means less than or equal to. This would not work as 75, 85, and 95 are greater than 65. Try adding a simple and statement that checks if it's louder than the other if statements.
01 | while true do |
02 | wait() |
03 | if script.Parent.speach.PlaybackLoudness < = 65 then |
04 | script.Parent.Mouth.Texture = "rbxassetid://2801767831" |
05 | elseif script.Parent.speach.PlaybackLoudness < = 75 and script.Parent.speach.PlaybackLoudness > 65 then |
06 | script.Parent.Mouth.Texture = "rbxassetid://2801751501" |
07 | elseif script.Parent.speach.PlaybackLoudness < = 85 and script.Parent.speach.PlaybackLoudness > 75 then |
08 | script.Parent.Mouth.Texture = "rbxassetid://845217767" |
09 | elseif script.Parent.speach.PlaybackLoudness < = 95 and script.Parent.speach.PlaybackLoudness > 85 then |
10 | script.Parent.Mouth.Texture = "rbxassetid://907601394" |
11 | end |
12 | end |
Please accept and upvote this answer if it helped.