So, I have this script:
script.Parent.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if hit and hit.Parent:FindFirstChild("Humanoid") then humanoid.WalkSpeed = 0 hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = workspace.CamerasCutscene1.Cam2.CFrame + Vector3.new(0, 0, 0) wait(2) humanoid.WalkSpeed = 9 end end)
and because of the wait(), the script won't work, if I delete it it works. But I really need that wait() to be there, can anyone tell me why, is this happening?
Thanks For Reading!
Your solution is actually a pretty common one. You need to add a Debounce to your script. The .Touched event gets called pretty quick multiple times. Adding a Debounce will get what you want. Here's an article to help you. Article.