So, I put this code into a part:
part = script.Parent while true do if part.Touched then print("STOP TOUCHING ME!!!!!") end wait() if part.TouchEnded then print("Oh, Finally.") end wait() end
And it started printing infinitely because another part was touching it. Could you know how to help?
Try using the event instead:
part.Touched:Connect(function(hitPart) if hitPart.Parent:FindFirstChildOfClass("Humanoid") then print("STOP TOUCHING ME!!!!!") end end) part.TouchEnded:Connect(function(hitPart) if hitPart.Parent:FindFirstChildOfClass("Humanoid") then print("Oh, Finally.") end end)