im scripting a script so when the player touches the startercharacters humanoid root part it kills the player and starterplayer plays a animation and sound. but the script isnt working
heres the code
local Humanoid = script.Parent.Parent.StarterCharacter.Bot
local debounce = false
local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://5906619440"
local killAnim = Humanoid:LoadAnimation(Anim)
script.Parent.Parent.StarterCharacter.HumanoidRootPart.Touched:Connect(function(Object)
if Object.Parent:FindFirstChild("Humanoid") and not debounce then
debounce = true
killAnim:Play()script.Parent.Parent.StarterCharacter.HumanoidRootPart.Anchored = true
game.Workspace.Jumpscare2:Play()
wait(0.5)
Object.Parent.Humanoid.Health = 0
game.Workspace.Hit:Play()
wait(2)
killAnim:Play()script.Parent.Parent.StarterCharacter.HumanoidRootPart.Anchored = false
wait(3)
debounce = false
end
end)
please help

2 comments
Error codes?
Is anything printed in the Output window?