So could someone help me please so I'm using an animation script as soon as the player activates proximityprompt in the workspace it plays the animation but I wanted for the animation to have to wait 15 seconds I already tried using wait( ) but the animation didn't work out for long before my other scripts run as soon as the prompt is triggered

local Players = game:GetService("Players")

local player = Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
	character = player.CharacterAdded:Wait()
end

local humanoid = character:WaitForChild("Humanoid")
local Animator = humanoid:WaitForChild("Animator")

local shockButton = workspace.C4.C4Disable
local proximityPrompt = shockButton.DisableButton1
local shockAnimation = Instance.new("Animation")
shockAnimation.AnimationId = "rbxassetid://9112394188"
local shockAnimationTrack = Animator:LoadAnimation(shockAnimation)
shockAnimationTrack.Priority = Enum.AnimationPriority.Action
shockAnimationTrack.Looped = false

local function onShockTrigger(player)
	shockAnimationTrack:Play()
	humanoid.Walkspeed = 0
	wait(15)
	shockAnimationTrack.Stopped:Wait()
	humanoid.WalkSpeed = 16
end

proximityPrompt.Triggered:Connect(onShockTrigger)

i got the script in DevForum i just changed some things that is in the case to detect my Proximity