How to make a touch to trigger animation

I’m making a game kind of like speed run and im trying to make it so when they touch the speed boost a running animation plays

image
It says this when i try to write script.Parent.Animaton:Play()

local speed = script.Parent

local function steppedOn(part)
local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then
parent.Humanoid.WalkSpeed = 60
script.Parent.Sound:Play()
end
end

speed.Touched:Connect(steppedOn)

where is the animation in the code

1 Like

nevermind the script worked ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

Please consider informing people that it is fixed :smiley:
mostly to not waste others time to figuring out what is the problem