The sound won’t play when the tool is activated. How do I fix this?
local Tool = script.Parent
local Axeanim = Tool.Axeanim
local db = false
local sound = script.Parent
Tool.Equipped:Connect(function(Mouse)
Tool.Activated:Connect(function()
local Character = Tool.Parent
if db == false then
db = true
local AnimationTrack = Character.Humanoid:LoadAnimation(Axeanim)
AnimationTrack:Play()
sound:Play()
wait(1)
db = false
end
end)
end)
local Tool = script.Parent
local Axeanim = Tool.Axeanim
local db = false
local sound = script.Parent.MySound -- you should try to avoid naming instances with classes' names
Tool.Equipped:Connect(function(Mouse)
Tool.Activated:Connect(function()
local Character = Tool.Parent
if not db then
db = true
local AnimationTrack = Character.Humanoid:LoadAnimation(Axeanim)
AnimationTrack:Play()
sound:Play()
task.wait(1)
db = false
end
end)
end)