--	local sound = SM.FetchSound(soundName)
--	local speed = sound.TimeLength


    if (Rep.Constants.RelativeTime.Value - _G.SD[player.UserId].Data.tempData.lastAction) >= 0.25 then
        _G.SD[player.UserId].Data.tempData.lastAction = Rep.Constants.RelativeTime.Value
        SM.PlaySoundInObject(soundName, char.Head, equippedToolData.noteWaver, 6)
    end
end)

Rep.Relay.Tool.StopMusicTool.OnServerEvent:connect(function(player, musicName)
	
	local char
    if player.Character and player.Character.Humanoid and player.Character.Humanoid.Health > 0 and _G.SD[player.UserId].Data.stats.health > 0 then
        char = player.Character
    else
        return
    end
	
	if not musicName then
	 	local equippedToolName = _G.SD[player.UserId].Data.equipment.toolbar[_G.SD[player.UserId].Data.tempData.equippedSlot].name
	    local equippedToolData = EntityData["Tool"][equippedToolName]
		musicName = equippedToolData.noteName
	end
	
	SM.StopSoundInObject(musicName, char.Head)
end)
