local tool = script.Parent
local function toolEquipped()
print(“PlaySound”)
tool.Handle.Equip:Play()
end
local function toolActivated()
tool.Handle.Activate:Play()
end
tool.Equipped:Connect(toolEquipped)
tool.Activated:Connect(toolActivated)
local tool = script.Parent
local function toolEquipped()
print(“PlaySound”)
tool.Handle.Equip:Play()
end
local function toolActivated()
tool.Handle.Activate:Play()
end
tool.Equipped:Connect(toolEquipped)
tool.Activated:Connect(toolActivated)
local tool = script.Parent
local Debounce = false
local function toolEquipped()
print("PlaySound")
tool.Handle.Equip:Play()
end
local function toolActivated()
if not Debounce then
Debounce = true
tool.Handle.Activate:Play()
wait(2)
Debounce = false
end
end
tool.Equipped:Connect(toolEquipped)
tool.Activated:Connect(toolActivated)
local tool = script.Parent
local handle = tool.Handle
local sound1 = handle.Equip
local sound2 = handle.Activate
local function toolEquipped()
repeat task.wait() until not sound1.IsPlaying
sound1:Play()
end
local function toolActivated()
repeat task.wait() until not sound2.IsPlaying
sound2:Play()
end
tool.Equipped:Connect(toolEquipped)
tool.Activated:Connect(toolActivated)
Instead of an arbitrary wait of 2 seconds you can instead wait for the sound instance to stop playing before playing it again.
local tool = script.Parent
local handle = tool.Handle
local sound1 = handle.Equip
local sound2 = handle.Activate
local function toolEquipped()
if sound1.IsPlaying then
sound1.Ended:Wait()
end
sound1:Play()
end
local function toolActivated()
if sound2.IsPlaying then
sound2.Ended:Wait()
end
sound2:Play()
end
tool.Equipped:Connect(toolEquipped)
tool.Activated:Connect(toolActivated)