local mood = script.Parent.Mood.Value
while mood == "Paranoid" do
local Dialog = game:GetService("Chat"):Chat(script.Parent.Head, say[math.random(1, #say)], Enum.ChatColor.Blue)
wait(math.random(5,9))
end
while mood == "Scared" do
local Dialog = game:GetService("Chat"):Chat(script.Parent.Head, say2[math.random(1, #say2)], Enum.ChatColor.Blue)
wait(math.random(2,3))
end
i'm trying to make an NPC say different stuff depending on the StringValue inside it, it's naturally set to "Paranoid", but when i change it ingame (Solo Test) to "Scared", it doesn't change, instead it keeps running the while loop, how do i fix this?

3 comments
So i did coroutine.wrap on both loops, and did them run only when a variable's properties is changed, but nothing works, i've noticed that it won't work at all if any condition is not met.
As I mentioned, you need to use the changed event to run it when the value changes.
And i did, yet nothing works.