Stop player movement when proximity prompt is activated

Hi,

How do I do stop player moment for 3 seconds? Like play sound, disable player movement for 3 seconds and then enable it again.

My current script it:

local PROMPT = script.Parent

PROMPT.Triggered:Connect(function(PLR)
	script.Parent.Promptsound:Play()
end)
1 Like

set the players WalkSpeed property to 0 wait 3 seconds then set the WalkSpeed to the old value

Set the players walk-speed to 0, wait 3, then set the players walkspeed back to whatever it was before.

Hi, how do I exactly implement this?

Just add into the prompt.triggered above the “Sound:Play()”:

local Hum = PLR:FindFirstChild(“Humanoid”)
local OldWalkSpeed = Hum.Walkspeed
Hum.Walkspeed = 0
wait(3)
Hum.Walkspeed = OldWalkSpeed

@Nabilekes

1 Like
local PROMPT = script.Parent

PROMPT.Triggered:Connect(function(PLR)
	script.Parent.Promptsound:Play()
local hum = PLR.Character:FindFirstChild("Humanoid")
local originalspeed = hum.WalkSpeed
hum.WalkSpeed = 0
task.wait(3)
hum.WalkSpeed = originalspeed
end)