Everytime I touch the part it's supposed to make my player say something, the saying something thing works but it doesn't stop so I tried making it so once h == 9 then it stops repeating. I know it has to do with something having a loop inside of something. Can someone help? Here's the problematic code
part.Touched:Connect(function(touch) if touch.Parent == player.Character then repeat h -= 1 ChatService:Chat(player.Character, "hi",Enum.ChatColor.White) until h == 9 end end)
It's most likely that it's firing too quickly and causing it to crash. If there's an exhaust error, change the repeat
to repeat wait()
and see if it fixes your problem.