I'm trying to get an "Eat" sound to be played, but it doesn't seem to work? Any ideas why?
Local Script
local animations = {"4614299228"}
local CanAttack = true
local Player = game:GetService'Players'.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Head = Character:FindFirstChild("Head")
local throw= Instance.new("Sound",Head)
throw.SoundId="rbxassetid://430285057"
script.Parent.Activated:connect(function()
if CanAttack == true then
CanAttack = false
local animation = Instance.new("Animation", script.Parent.Parent)
animation.AnimationId = "http://www.roblox.com/asset?id="..animations[math.random(1, #animations)]
local chosenanim = script.Parent.Parent.Humanoid:LoadAnimation(animation)
chosenanim:Play()
throw:Play()
wait(.5)
script.Parent.Handle.Transparency = 1
wait(.5)
throw:Stop()
wait(1)
script.Parent.Handle.Transparency = 0
CanAttack = true
end
end)

2 comments
This is a server or local script? Are any errors thrown?
No errors thrown and it's a LocalScript Within A Tool